It was not only once that some of our Clients contacted us with “hey, I’m paying X euros per month for pricy server and my site loads slowly, can you check what’s going on?” and tasks like those usually come to me. Almost every time I see that the server did its job worth the money it is paid, but the screen is still white waiting for the external (analytics, containers, other measuring tools) scripts to be loaded on the visitor’s side. In the era of fast computers and Internet that’s pretty annoying, right?
First, let me introduce you with the basic bits of what actually happens: most of the content (text, page styling, images, etc.) is served from site’s native server, but there is also much invisible content, for which, non-nerds are not even aware of. Someone, whose job is to improve the shop’s sales says: “hey, let’s attach some monitoring tools to analyze visitors behavior”. That is usually done by putting scripts in Google Tag Manager (or containers provided by other services) which are called by the page and executed while loading the page. Those scripts are external, which means the raw content is loaded, but now your browser is waiting for the other servers (not where the shop is) to respond with their content. Imagine your browser needs to wait for 1 (native server) + 10 (or 20 or 30 or 40 – without exaggeration) servers to complete the page load. Do you feel the congestion now? And not everyone has the latest Ryzens with dozens of GB of RAM and the fastest Internet there is to load the page in a millisecond. Even with conditions just mentioned – it won’t.
Those containers are something like Trojan Horse (do not confuse with a PC virus) in Antic Greece – you don’t know what’s inside. But if you look inside you will find tons of analytics, metrics, click counters, mouse movement tracking tools, a/b testing tools, ads… When you put alltogether, the page looks like this:
…and imagine it’s speed.
Here is list of scripts loaded within each page from one live webshop: ad.360yield.com, ads.stickyadstv.com, ads.yahoo.com, ads.yieldmo.com, apis.google.com, az416426.vo.msecnd.net, bam.eu01.nr-data.net, beacon.krxd.net, cdn.smct.co, cdn.stickyadstv.com, cm.g.doubleclick.net, connect.ekomi.de, connect.facebook.net, criteo-partners.tremorhub.com, criteo-sync.teads.tv, cw.addthis.com, dis.criteo.com, dis.eu.criteo.com, dwin1.com, eb2.3lift.com, facebook.com, fonts.googleapis.com, fonts.gstatic.com, google-analytics.com, google.ca, google.com, googleads.g.doubleclick.net, googleadservices.com, googletagmanager.com, gstatic.com, gum.criteo.com, i.liadm.com, jadserve.postrelease.com, js-agent.newrelic.com, manychat.com, match.adsrvr.org, match.sharethrough.com, maxcdn.bootstrapcdn.com, pixel.advertising.com, pixel.rubiconproject.com, pixel.tapad.com, play.google.com, r.casalemedia.com, robincontentdesktop.blob.core.windows.net, rtbcc.fyber.com, sc.tradetracker.net, script.hotjar.com, secure.adnxs.com, selfservice.robinhq.com, simage2.pubmatic.com, smct.co, sp.analytics.yahoo.com, sslwidget.criteo.com, static.criteo.net, static.hotjar.com, staticxx.facebook.com, sy.eu.angsrvr.com, sync.ligadx.com, sync.outbrain.com, tags.bluekai.com, trc.taboola.com, us-u.openx.net, v2.zopim.com, vars.hotjar.com, visitor.omnitagjs.com, widget.eu.criteo.com, widget.manychat.com, x.bidswitch.net.
Browsers, unlike people reading blog posts, are not skipping, so imagine how slower would you come to this paragraph if you didn’t skip 68 list items from the previous one. That’s exactly what happens with your browser (if you don’t have any AdBlock, for example). Browser doesn’t decide itself if should skip the boring paragraph, but reads everything that is served.
Did you know that page loading time also affects your organic search rank? Just saying…
“OK, enough with nerd facts, what should I do with the scripts?”
First, ask yourself is it really that worth the effort putting all those scripts?
If you have fancy analytics tools running (heatmaps, etc.): are you actually on a structured basis reviewing the information to improve your webshop? Then it could be worth keeping them, but if you are not doing that and scripts are just “running” without any reason or actions being taken you should consider removing them.
Happier and faster New Year!
Author: Nebojša Stojilković
Web developer @ Younify