Site icon Catch Themes

Adding Script to header | Google Analytics Tracking

Hi Sakin, I have a brief question. The university I work at would like to also track google analytics of my WordPress site through their own UA code. I already have a code and am internally tracking it through Yoast, and I don't want to lose that data. I was told that I could put the script (below) with the appropriate UA code on my template header. Could you tell me exactly where I should place it? Would it be "Appearance > Editor > Header (header.php)? Here is the script: _____________________________________________________________________ <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', '--------------', 'auto'); ga('send', 'pageview'); </script> ____________________________________________________________________ Any info at your convenience would be greatly appreciated. Many thanks, SBartsch
Exit mobile version