How the Normal Google Analytics Code Looks Like:
If you have installed Google Analytics code for tracking the visitors count then below is how the code looks like
<script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXXXXX-1']); _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>
Modified Analytics Code:
The below is tweaked code which will dramatically reduce your bounce rate by 60-90%.
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX-1']);
_gaq.push(['_trackPageview']);
setTimeout(function() {
window.onscroll = function() {
window.onscroll = null; // Only track the event once
_gaq.push(['_trackEvent', 'scroll', 'read']);
}
}, 5000);
(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>
Note: All you have to do is change XXXXXXX with your Google Analytics ID which you can find easily from the original code.
The below is a screenshot of the Analytics Report before and after implementing the Tweak:
How it Works?
Google Analytics wait’s till the second event is triggered, that means unless the visitor clicks on other page of your site the visit will be considered as bounce.What did we do to the code?
We triggered the actual code and did some modification for a fair measure of bounce rate.This code considers only those visitors who left the site within the first 5 seconds.We also added one more parameter to the code, i.e if a visitor scrolls down to read the web page the visit will no more be considered as bounce.Final Words:
Google Analytics official blog has confirmed that we can adjust the bounce rate to our need and analyse the performance of the site/blog.You can tweak the above adjusted code as well and change the delay time for your own needs.thankyou.
No comments:
Post a Comment