Translatable 3rd party cookies script fields
-
Hello,
first of all, thank you for this great plugin! It has helped me a lot and made my life simpler 🙂
On the page I’ve provided the link, I’m using WPML for translations, and my client needs 3 different analytic codes, one for each domain. We’re using WPML’s option for the different domain for each language. Until now, I’ve solved their issue with the code below.
Basically, we need the script fields under 3rd party plugin tab to be translatable, can you do that, please?
The code in the head:
<?php if(ICL_LANGUAGE_CODE==’hr’){?>
<script>
(function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,’script’,’//www.google-analytics.com/analytics.js’,’ga’);ga(‘create’, ‘UA-code-1’, ‘auto’);
ga(‘send’, ‘pageview’);
ga(‘set’, ‘anonymizeIp’, true);</script>
<?php } elseif(ICL_LANGUAGE_CODE==’it’){?>
<script>
(function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,’script’,’//www.google-analytics.com/analytics.js’,’ga’);ga(‘create’, ‘UA-code-2’, ‘auto’);
ga(‘send’, ‘pageview’);
ga(‘set’, ‘anonymizeIp’, true);</script>
<?php } elseif(ICL_LANGUAGE_CODE==’en’){?>
<script>
(function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,’script’,’//www.google-analytics.com/analytics.js’,’ga’);ga(‘create’, ‘UA-code-3’, ‘auto’);
ga(‘send’, ‘pageview’);
ga(‘set’, ‘anonymizeIp’, true);</script>
The page I need help with: [log in to see the link]
The topic ‘Translatable 3rd party cookies script fields’ is closed to new replies.