Mini-optimization of statistics / analytics counters on your web page

VN:F [1.9.22_1171]
Rating: 5.0/5 (1 vote cast)

Today working on site optimization, made small javascript optimization for several counters on website.

Problem: You are using 2-4 statistic counters on Your page. Most of them are using javascript and for noscript mode image (GIF).

Solution: Split them and then merge :)

Micro optimization for analytics counters

Most of codes on my site were with one inline javascript code, code from counter’s site and noscript solution.

Spliting inline javascript counter code

First You need to examine all statistics codes, because some have some id before included javascript (like Google Analytics, StatCounter.com or Quantcast) and some after (Yandex). So what we need is take all inline javascripts and put them inside <script> tags, them links put all external janasvripts and then again inline javascript for counters, which use inline script after external javascript.

Here is mine for SimpleMediaCode.com:

optimize javasacript counters

VN:F [1.9.22_1171]
Rating: 5.0/5 (1 vote cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)
Mini-optimization of statistics / analytics counters on your web page, 5.0 out of 5 based on 1 rating

Today working on site optimization, made small javascript optimization for several counters on website. Problem: You are using 2-4 statistic counters on Your page. Most of them are using javascript and for noscript mode image (GIF). Solution: Split them and then merge :) Micro optimization for analytics counters Most of codes on my site were […]

Only one response to Mini-optimization of statistics / analytics counters on your web page

deni2s

#23

(you will know missing symbol here) hope this time it will work ;)

div id=”counters”> script type=”text/javascript”>var sc_project=5944257;var sc_invisible=1;var sc_security=”907a045c”;_qoptions={acct:”p-d3CGZbJaLL9s”};try {var yaCounter1201847=new Ya.Metrika(1201847);}catch(e){} /script> noscript> img src=”http://mc.yandex.ru/watch/1201847″ alt=”" /> img class=”statcounter” src=”http://c.statscounter.com/5944257/0/908a045c/1/” alt=”" /> img src=”http://pixel.quantserver.com/pixel/p-d3CGZbJa1LL9s.gif” alt=”" /> /noscript> /div>

inside external css file:
#counters{display:none;position:absolute}

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>