• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 google analytics not Work

#1
my google analytics code
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-123456-7', 'auto');
  ga('send', 'pageview');

</script>
my site layout
Code:
    <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', 'UA-123456-7', 'auto');
  ga('send', 'pageview');

</script>
google_analytics Templates code
Code:
<xen:if is="{$xenOptions.googleAnalyticsWebPropertyId}"><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', '{$xenOptions.googleAnalyticsWebPropertyId}', 'auto');

  ga('send', 'pageview');


</script></xen:if>
 

Brogan

XenForo moderator
Staff member
#2
How are you entering your GA code?

You just enter it in the ACP -> Options -> Google Integration -> Google Analytics Web Property ID
 
#5
But the Google still show

Tracking ID
UA-69464498-1
Status: Tracking Not Installed
Last checked: Oct 29, 2015 4:59:41 PM PDT
The Google Analytics tracking code has not been detected on your website's home page. For Analytics to function, you or your web administrator must add the code to each page of your website.
Learn more
 

Mike

XenForo developer
Staff member
#6
GA may not be picking it up because your board is closed (temporarily unavailable). It should still start reporting soon.
 
#7
I'm running into this same snag. I actually installed Wordpress on the front end to install it through a Wordpress plugin (Xenforo still runs and appears through /forum). What's interesting is real time will show active users, but it's not recording their activity.
 

Mark T

Active member
#9
Google recommends you use the asynchronous tracking code. This should always be located in the <head> section.

XF pushes it there, but if you use the Defer JS modification, this is then pushed to below the </head>.

Then your webmaster tools will no longer recognise your property verification.