Fernando, wonder if you can offer a little help on this. I have set my categories in the GDPR settings for neccessary, Analytics and AddThis (Social Sharing), and confirmed the relevent cookies in each category. However, I am not clear how to tie this up with the javascript code in the article, mentioned, above (since I am using SuperCache, I assume I will need the javascript code);
if ( ! is_allowed_cookie( ‘_ga’ ) ) {
window[‘ga-disable-UA-XXXXXXXX-X’] = true; // Don’t forget to replace X for your actual UA numbers.
}
Can you please confirm where I insert this code, including any javascript tags, and how I match it to my category settings?
For analytics, my code is (inserted in Head) and I want to set it to “Checked” i.e. activated, once accepted by teh visitor);
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-384975-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-384975-1');
</script>
For AddThis, my code is and I want to set it to “unchecked” i.e. not activated, once accepted by the visitor);
The code to insert before the closing body tag is;
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5b1e6471881b140b"></script>
The code to insert the Social Share Inline Buttons is;
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<div class="addthis_inline_share_toolbox"></div>
Hope you can help.
-
This reply was modified 6 years, 5 months ago by bsthp.