-
AuthorPosts
-
September 9, 2019 at 1:50 pm #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, 2 months ago by Jarmo.
September 11, 2019 at 5:26 am #1136880Hey 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,
IsmaelSeptember 11, 2019 at 10:59 am #1136984Hi Ismael,
But where do I place the mentioned script?
Regards,
JarmoSeptember 11, 2019 at 11:00 am #1136985Another question, how to deal with a Facebook Pixel?
September 12, 2019 at 4:35 am #1137350Hi,
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,
IsmaelSeptember 12, 2019 at 9:34 am #1137435Yes 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 -->
September 16, 2019 at 1:50 am #1138607Hi,
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,
IsmaelSeptember 16, 2019 at 9:31 am #1138714Hi,
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,
JarmoSeptember 16, 2019 at 9:26 pm #1138939Hi 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 -
AuthorPosts
- You must be logged in to reply to this topic.