Support » Plugin: GDPR Cookie Compliance » How to add scripts

  • Resolved zebrahosting

    (@zebrahosting)


    Just tried adding the Facebook pixel code in the header field of the third party cookie field.

    Something like this:
    <!– Facebook Pixel Code –>
    <script>
    !function(f,b,e,v,n,t,s)
    {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
    n.callMethod.apply(n,arguments):n.queue.push(arguments)};
    if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version=’2.0′;
    n.queue=[];t=b.createElement(e);t.async=!0;
    t.src=v;s=b.getElementsByTagName(e)[0];
    s.parentNode.insertBefore(t,s)}(window, document,’script’,
    https://connect.facebook.net/en_US/fbevents.js&#8217;);
    fbq(‘init’, ‘179040319425970’);
    fbq(‘track’, ‘PageView’);
    </script>
    <noscript><img height=”1″ width=”1″ style=”display:none”
    src=”https://www.facebook.com/tr?id=17904xxxxxxx@dev=PageView&noscript=1&#8243;
    /></noscript>
    <!– End Facebook Pixel Code –>

    But don’t get the pixel in the pages. It seems so simple but doesn’t work on any or our sites. Should I remove the script tags? Only place the pixel itself?

    Please advice.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi there,

    Thanks fro your comments. The script tags should be there, and the tracking script looks good to me. You can add to the 3rd party or advanced tab head section. Our plugin loads the script with Javascript, and that’s why you can’t find it in the view-source page. You can try the developer console in Chrome (inspect element) and find the scripts.

    I hope this helps.

    Hi Gasper, thanks for the clarification. We did everything by the book but the pixels never worked. At least FB complaints and my FBpixels helper info in Chrome could not find it properly. Not when placed in head, not when placed in footer.
    We see the setting back in the console as warning:
    [Warning] {strict: “1”, thirdparty: “1”, advanced: “1”} (main.js, line 1)

    When we switch on our preferred option PixelYourSite it all works but see no way to switch it on or off by GDPR extension. (See question in other thread)
    GDPR Cookie Compliance is still our preferred plugin voor all our sites and would love to get it working properly.

    (thank you very much for making this plugin available)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add scripts’ is closed to new replies.