form2emailhelp
form2emailhelp

Reputation: 1

How do I make http://www.google-analytics.com/ga.js Asynchronous

I am fairly new to all this but getting to grips with it. I want to get the website www.norfolktutors.co.uk to the top in a google search.
However I am being asked to make my script asynchronous. I don't understand what that means, can someone explain in simple english please.

The code for the script is:

 <script src="demo_async.js" async></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-45579551-1', 'norfolktutors.co.uk');
  ga('send', 'pageview');
</script>

What do I remove?

I have put this script at the bottom of the page, as advised by google webmaster.

Upvotes: 0

Views: 1213

Answers (1)

Nick Blexrud
Nick Blexrud

Reputation: 9603

There is some splendid information on Google Analytics in Google Developers. By default, the snippet is asynchronous.

Per Google Developers:

When the code runs, it asynchronously loads the Google Analytics Tracking Code onto the page. It then creates a tracker object for the web property you specified in the UA-XXXX-Y parameter. Finally, it records a pageview in Google Analytics for the page that the script was run.

To answer your question then, you shouldn't have to remove anything.

Upvotes: 3

Related Questions