Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1136001

    Hi,

    How can I create a toggle for activating and deactivating Google Tag Manager code in the cookie setting modal window.
    So on activating the toggle switch this code is being added:

    //Added to head
    <!-- Google Tag Manager -->
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','GTM-1234567');</script>
    <!-- End Google Tag Manager -->
    
    //Added to body
    <!-- Google Tag Manager (noscript) -->
    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-1234567"
    height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
    <!-- End Google Tag Manager (noscript) -->
    • This topic was modified 5 years, 3 months ago by Jarmo.
    #1136880

    Hey jarmo@groeier.nl,

    Thank you for the inquiry.

    You can add the “[av_privacy_google_tracking]” privacy shortcode to give users the option to disable the tracker when they want.

    Best regards,
    Ismael

    #1136984

    Hi Ismael,

    But where do I place the mentioned script?

    Regards,
    Jarmo

    #1136985

    Another question, how to deal with a Facebook Pixel?

    #1137350

    Hi,

    Thank you for the update.

    You can add it in the privacy page or the modal popup window. Did you enable the cookie consent bar in your site?Make sure that you’re on version 4.6.1. For more info, please visit the documentation.

    // https://kriesi.at/documentation/enfold/privacy-cookies/#implementation-of-data-security-in-enfold

    Best regards,
    Ismael

    #1137435

    Yes I have installed version 4.6.1 but where do I place the code?
    It is not very clear to me now.

    For example this code:

    <!-- 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');
      fbq('init', 'your-pixel-id-goes-here');
      fbq('track', 'PageView'); </script> <noscript> <img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=your-pixel-id-goes-here&ev=PageView&noscript=1"/> </noscript> <!-- End Facebook Pixel Code -->
    #1138607

    Hi,

    Yes I have installed version 4.6.1 but where do I place the code?

    You can include the code in the in the Enfold > Google Services > Google Analytics > Google Analytics Tracking Code field.

    Or use the wp_head hook to append the script in the head tag If you don’t want to mix it with the GA tracking code.

    // https://developer.wordpress.org/reference/functions/wp_head/

    add_action('wp_head', function() {
    ?>
    <!-- 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');
      fbq('init', 'your-pixel-id-goes-here');
      fbq('track', 'PageView'); </script> <noscript> <img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=your-pixel-id-goes-here&ev=PageView&noscript=1"/> </noscript> <!-- End Facebook Pixel Code -->
    <?php
    });

    Best regards,
    Ismael

    #1138714

    Hi,

    I know how to implement the code in the head but how do I turn it on or off with the cookie modal popup because visitors need to be able to disable the facebook pixel tracking.

    Regards,
    Jarmo

    #1138939

    Hi Jarmo,

    This part is out of the scope of our suppport, you’ll need to hire someone to customize it for you.

    Best regards,
    Victoria

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.