Where to put Google Analytics code ?

brussbx

Member
Oct 21, 2020
68
12
8
Morocco
jebbari.com
i fixed it thanks to all of you , just changed my domain with : yourdomain
Code:
https://yourdomain/admin.php?templates/google_analytics.820/edit&style_id=1

then deleted Xenforo Code:
Code:
<xen:if is="{$xenOptions.googleAnalyticsWebPropertyId}"><script>

    var _gaq = [['_setAccount', '{$xenOptions.googleAnalyticsWebPropertyId}'], ['_trackPageview']];
    !function(d, t)
    {
        var g = d.createElement(t),
            s = d.getElementsByTagName(t)[0];
        g.async = true;
        g.src = ('https:' == d.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        s.parentNode.insertBefore(g, s);
    }
    (document, 'script');

    </script><xen:comment><!--Adapted from http://mathiasbynens.be/notes/async-analytics-snippet--></xen:comment></xen:if>

then add the code like this :

Code:
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-37255431-1']);
  _gaq.push(['_setDomainName', 'harpoongaming.com']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
 

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu