XF 1.3 Manually adding Google Analytics to the footer

imthebest

Well-known member
#1
Hi guys I'm a vBulletin old school guy. I know that XF easily allows you to put your Analytics ID to automatically start gathering data however I want to use Universal Analytics with Demographics & Interests Data (in black).

Code:
<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-XXXXXXX-X', 'auto');
  ga('require', 'displayfeatures');
  ga('send', 'pageview');
</script>
So I tried inserting that code snippet to the end of my footer template (like I do on vBulletin) however Google says that the tracking code isn't installed. I don't know what I'm doing wrong... please help.
 

Mike

XenForo developer
Staff member
#4
If you see the code in the source of the page, it's really down to what Google may or may not be reporting. If you don't see it in the page, I suspect there was a mistake with where you added it.
 
Top