A little bit code modify to be Asynchronous Tracking mode that help to improve the page loading is faster. (Asynchronous tracking is an improved way to track website visitors with Google Analytics. Unlike a traditional installation, asynchronous tracking optimizes how browsers load ga.js so its impact on user experience is minimized. It also allows you to put your Analytics snippet higher in the page without delaying subsequent content from rendering.) From:
<script type="text/javascript">var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
To:
$google_analytics_javascript = '
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', ''.$web_property_id.'']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
';
Download Google Analytics in Asynchronous Tracking
| < Prev | Next > |
|---|
Newer news items:
- 23/12/2011 11:40 - How does Adsense make money for you?
- 18/09/2011 13:05 - MSN Chat! Module
- 11/09/2011 21:29 - Document Approval Workflow System
- 06/09/2010 15:19 - เพิ่ม Revolver Visitor Maps
- 06/09/2010 14:15 - Captcha for Joomla site
























