• Hello,

    I’m trying to exclude a visitor JS tracking pixel from 3 thank you pages (but have it placed everywhere else). I’m attempting to use Conditional Tags to edit the header.php but using the code below the site crashes (white screen/does not load)…..any help would be much appreciated.

    <?php????if( ! (is_page(‘advertise-with-nanigans-thank-you’) || is_page(‘success’) || is_page(‘ty-subscribe’) ) ) : ?>
    <script>
    // NaN_api = [[app_id, user_id], [type, name, value, extra]];
    NaN_api = [[555555], [‘visit’, ‘landing’]];
    (function()
    { var s = document.createElement(‘script’); s.type = ‘text/javascript’; s.async = true; s.src = ‘//cdn.nanigans.com/NaN_tracker.js’; var h = document.getElementsByTagName(‘head’)[0]; h.appendChild(s); }
    )();
    </script>
    <?php endif; ?>

  • The topic ‘Conditional Tag to Exclude/Suppress JS from certain pages’ is closed to new replies.