Google Analytics Tracking code

Hello, I was wondering where is it that should put my analytics code between
the head tags or before the closing body tag?

I currently have it before the closing body where my other scripts are.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="Scripts/dropdown_language.js" ></script>
<script src="Scripts/bootstrap.min.js"></script>
<script src="//use.typekit.net/xsr0nkz.js"></script>
<script>try{Typekit.load({ async: true });}catch(e){}</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-57297790-2', 'auto');
  ga('send', 'pageview');

</script>   
</body>

Perfect :thumbsup: .

1 Like

ok and it takes a few days for it to start tracking or is it immediate?

Should be immediate, assuming users aren’t viewing a cached version of your page.

Now, Google might take a day or so to actually report to you about the analytics (at first). Not sure.

1 Like

Yes, last I knew once Google has verification that the site is indeed yours it will start gathering data. Then a few days later when there is enough to be worth reporting to you. it will.

wow how would it know that is mine?

I guess that makes sense…

Did you do this?

It is receiving data now.

I verified it through Verify site ownership on Google Search Console

I could not find the verification for the tracking though

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.