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

XF 1.5 Analytics - Bad Event Tracking Code

Discussion in 'XenForo Questions and Support' started by Solidus, Aug 6, 2016.

  1. Solidus

    Solidus Well-Known Member

    Hi team.

    This error is showing in Google Analytics,


    Using the Tag Assistant as recommended, I am told "Code found outside of <head> tag". Which is confusing because the google_analytics template is called in PAGE_CONTAINER immediately before </head>, like so,

    <xen:include template="google_analytics" />
    But when viewing the page source of forum index, this is on line 2667

    ga('create', 'UA-51233726-1', 'auto');
        ga('send', 'pageview');
    and </head> is on line 86. Any idea what is going on here?
  2. Mike

    Mike XenForo Developer Staff Member

    You have an add-on installed that moves all of the JS code to the end of the <body> tag.
    Solidus likes this.
  3. Solidus

    Solidus Well-Known Member

    I totally forgot I was doing that, thanks a lot Mike.

Share This Page