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

XF 1.3 Update Analytics Tracking Code to Support Display Advertising

Discussion in 'XenForo Questions and Support' started by asusforo, May 5, 2014.

  1. asusforo

    asusforo Member

    I received an message from Google with the request to update my Analytics tracking code, so i can receive
    Demographics and Interest Reports and support display advertising.

    see more information on: https://support.google.com/analytics/answer/2444872?hl=en&utm_id=ad

    At this moment i use the general google_analytics template and i added my tracking ID in admin stats options.

    But how can i implement the new tracking code? And i dont know if Xenforo is using the classic or the universal code?

    Google says:

    Im new in this world, so please support me.
     
  2. asusforo

    asusforo Member

    no replies at all?
     
  3. Brogan

    Brogan XenForo Moderator Staff Member

    Edit the google_analytics template if you wish to change the default analytics code.
     
  4. asusforo

    asusforo Member

    can i just put the new analytics universal code into google_analytics template and thats all?
     
  5. Tracy Perry

    Tracy Perry Well-Known Member

    You mean like this?

    Code:
    <xen:if is="{$xenOptions.googleAnalyticsWebPropertyId}">
    <!-- Google Analytics -->
    <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>
    <!-- End Google Analytics -->
    </xen:if>
    :D
     
  6. Bram

    Bram Well-Known Member

    @Tracy Perry the OP needs to have the specific "display advertising" part included I think.

    Was just reading about this topic myself and not sure what it even does when you implement the doubleclick cookie.
     
  7. Tracy Perry

    Tracy Perry Well-Known Member

    Yep, but the point I was attempting to get across is that you can place the new code base in there (with any additional parameters that GA reflects you can use) and replace the default one. ;)
     
    Bram likes this.

Share This Page