
Google Analytics Now Runs Asynchronously
The new code looks like this:
This means that Google.analytics will no longer slow down the loading of your site :)
UPD: That is, he downloaded his 24kb ga.js during page loading, now he can do it after ...
But after the first download, it is usually cached and at all other sites use the same :) Related
materials:
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script');
ga.src = ('https:' == document.location.protocol ? 'https://ssl' :
'http://www') + '.google-analytics.com/ga.js';
ga.setAttribute('async', 'true');
document.documentElement.firstChild.appendChild(ga);
})();
This means that Google.analytics will no longer slow down the loading of your site :)
UPD: That is, he downloaded his 24kb ga.js during page loading, now he can do it after ...
But after the first download, it is usually cached and at all other sites use the same :) Related
materials:
We take into account the CIS search engines
var _gaq = _gaq || [];
_gaq.push(
['_setAccount', 'UA-XXXXXX-X'],
['_setDomainName', 'your.domain.name'],
["_addOrganic", "mail.ru", "q"],
["_addOrganic","rambler.ru", "words"],
["_addOrganic","nigma.ru", "s"],
["_addOrganic","blogs.yandex.ru", "text"],
["_addOrganic","webalta.ru", "q"],
["_addOrganic","aport.ru", "r"],
["_addOrganic","akavita.by", "z"],
["_addOrganic","meta.ua", "q"],
["_addOrganic","bigmir.net", "q"],
["_addOrganic","tut.by", "query"],
["_addOrganic","all.by", "query"],
["_addOrganic","i.ua", "q"],
["_addOrganic","online.ua", "q"],
["_addOrganic","a.ua", "s"],
["_addOrganic","ukr.net", "search_query"],
["_addOrganic","search.com.ua", "q"],
["_addOrganic","search.ua", "query"],
["_addOrganic","poisk.ru", "text"],
["_addOrganic","km.ru", "sq"],
["_addOrganic","liveinternet.ru", "ask"],
["_addOrganic","gogo.ru", "q"],
["_addOrganic","gde.ru", "keywords"],
["_addOrganic","quintura.ru", "request"],
['_trackPageview']
);
(function() {
var ga = document.createElement('script');
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
ga.setAttribute('async', 'true');
document.documentElement.firstChild.appendChild(ga);
})();
* This source code was highlighted with Source Code Highlighter.