Google Analytics has gone through a number of changes over the years. If you have been using it for along time you might remember the older Urchin tracking code. Then, they added a lighter Asynchronous code and for a while you were given the option of using one or the other. Now if you are new or login to your Google Analytics account the only option available seems to be the Asynchronous code.
Dolphin 7 Footer Method / Location
In the footer before </body> tag
Open /templates/base/_footer.html
Add the Asynchronous Google Analytics code:
<bx _ injection:injection _ footer />
<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>
</body>
</html>
Save the changes back to your hosting account.
Dolphin 7 Header Method / Location
In the header between <head> and </head> tags
Open /templates/base/_header.html
Add the Asynchronous Google Analytics code:
<bx _ injection:injection _ head />
<script type="text/javascript">
var oBxUserStatus = new BxUserStatus();
oBxUserStatus.userStatusInit('<bx _ url _ root />', __ is _ profile _ page __);
</script>
<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>
</head>
__ flush _ header __
<body <bx _ injection:injection _ body /> >
<bx _ injection:injection _ header />
<div id="notification _ window" class="notifi _ window"></div>
<div id="FloatDesc" style="position:absolute;display:none;z-index:100;"></div>
Save the changes back to your hosting account.
Clear Dolphin 7 Cache
Login to your Dolphin 7 Administration panel and clear template cache for the changes to take effect.
Visit and refresh your homepage.
View source / View page source with your favorite browser and verify the Google Analytics code is present.
Wait 24 hours for stats to update and start reporting.
In the footer before </body> tag
Open /templates/base/_footer.html
<bx _ injection:injection _ footer />
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-XXXXX-X";
urchinTracker();
</script>
</body>
</html>
Save the changes back to your hosting account.
Clear Dolphin 7 Cache
Login to your Dolphin 7 Administration panel and clear template cache for the changes to take effect.
Visit and refresh your homepage.
View source / View page source with your favorite browser and verify the Google Analytics code is present.
Wait 24 hours for stats to update and start reporting.