Analytics
4K members online now
4K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Google Analytics JS Script making my website slow

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello GA Community,

 

Looking at the pingdom waterfall in the link below:

https://tools.pingdom.com/#!/dInihU/

 

you will see that the following file:

https://www.google-analytics.com/r/collect...

 

Has a size of 0 bytes but still takes 900ms to load. Is there anything wrong with our implementation of Google Analytics? How can we reduce the load time of that file?

 

Thank you very much in advance.

1 Expert replyverified_user

Google Analytics JS Script making my website slow

Explorer ✭ ✭ ☆
# 2
Explorer ✭ ✭ ☆

Hi,

 

The collect request of analytics (0 bytes), the green part basically represents the receive time, but the web browser doesn't receive anything from server (I guess).

 

Try pasting the analytics code in before closing head tag. (might not solve the issue but still)
Also try checking on other tools like : https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fwww.thrivingreviews.com%2F...
m

Google Analytics JS Script making my website slow

[ Edited ]
Participant ✭ ✭ ✭
# 3
Participant ✭ ✭ ✭

Hi,

 

For me, it seems like GA doesn't have a huge impact on your page load time.

 

I am sure that there are way more serious bottlenecks that you should work on in order to reduce your load on the page.

 

You're right. The GA HTTP request process doesn’t impact our page speed or more accurately the perceived page render process but does impact our page load time i.e. the time between when the browser started to download our page to the moment all resources are completed. But we'll need to live with that if GA is important to us.

 

Google Analytics tracking code is asynchronous (async is only for the download process), meaning that the browser doesn't need to wait for the code to finish loading to continue rendering elements that come after it on the page. So as @Ritwik B already mentioned, you can safely put the code at or near the top of your page.

 

Hope this helps.

Taavi

Re: Google Analytics JS Script making my website slow

Top Contributor
# 4
Top Contributor

Hi @contact,

 

I typically see some bytes (and load performance) for Google Analytics. Here is one site with the same test as yours:

 

pingdom-analytics-speed.png

 

Download Google Tag Assistant, a free Google Chrome web browser extension that will let you verify your tracking code is working correctly. You can learn more the technical workings here

 

You also may like to use Google Tag Manager, which is what is being used with the test site above, along with it being added at top of page, versus the bottom. You can learn more about the technical workings here.  

 

Kind Regards,

 

James

_________________________________________________________
Google AdWords Top Contributor | Google Partner | GYBO | Local Guide | My Profile