Hi Ben,
just checking before doing a lot of damage:
Google Analytics tells me to use a different script when activating Google Adwords tracking code on my site. I found the scripts.php from /lib-directory where the analytics script is visible
function kadence_google_analytics() { ?>
<script>
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
e.src=’//www.google-analytics.com/analytics.js’;
r.parentNode.insertBefore(e,r)}(window,document,’script’,’ga’));
ga(‘create’,'<?php echo GOOGLE_ANALYTICS_ID; ?>’);ga(‘send’,’pageview’);
</script>
the script that I am advised to use is
<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’, ‘GOOGLE_ANALYTICS_ID’, ‘domain.com’);
ga(‘send’, ‘pageview’);
</script>
QUESTION: Should I alter the script.php accordingly? What happens when I’m updating the theme to a new version? Changes gone? I am using a child theme, can I use it to do the needed script.php changes?
Thanks again, Hannu