Unleash the Power of Digital Marketing

Essential Insights, Helpful Tips, Topical Advice, and General Musings

All posts

Web Analytics Tips - Enhanced Implementation to Support Multiple Events/Pages Tracking

If your site has standard headers and footers dynamically included on most if not all pages and you have any of the following situations, this implementation advice could help.

  • You show videos on many pages throughout the site
  • You use actionable flash items on many pages
  • You have multiple types of forms/conversions on the website (order conversion, e-mail sign-up, catalog request, contact forms, etc…)
  • Or other similar multiple events on multiple pages situations

The following suggestion applies to any analytics/tracking systems which use an included file and a section of code that is for on-page implementation.  I’ll demonstrate two types of solutions Google Analytics and Omniture SiteCatalyst which follow the aforementioned format.

In most cases, a site will have a standard header and a standard footer dynamically included to structure the top and bottom sections of most if not all pages on the site.  As such the following shows how to setup the basic Google Analytics and SiteCatalyst scripts to allow you more flexibility with custom event and custom variable tracking:

Inside your HEADER INCLUDE File (usually after the open <body> tag):

If Using Google Analytics – Header Section Would Be:

<!-- Start Google Analytics Tracking for ALL Pages Header Script -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<!-- End Google Analytics Tracking for ALL Pages Header Script -->

If Using Omniture SiteCatalyst – Header Section Would Be:

<!-- Start Omniture SiteCatalyst Analytics Tracking code for ALL Pages Header Script -->
<script language="JavaScript" src="//www.mydomain.com/s_code.js"></script>
<!-- End Omniture SiteCatalyst Tracking code for ALL Pages Header Script -->

 

Inside your FOOTER INCLUDE File (before the close </body> tag):

If Using Google Analytics – Footer Section Would Be:

<!-- Start Google Analytics Tracking for ALL Pages Footer Script -->
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-###########");
pageTracker._trackPageview();
} catch(err) {}</script>
<!-- End Google Analytics Tracking for ALL Pages Footer Script -->

 

If Using Omniture SiteCatalyst – Footer Section Would Be Like:

<!-- Start Omniture SiteCatalyst Analytics Tracking code for ALL Pages Footer Script -->
<script language="JavaScript" src="//www.mydomain.com/identifier.js"></script>
<noscript><img
src="https:///################.122.2O7.net/b/ss/################/1/H.1--NS/0"
height="1" width="1" border="0" alt="" /></noscript><!--/DO NOT REMOVE/-->
<!-- End Omniture SiteCatalyst Tracking code for ALL Pages Footer Script -->

 

NOTE: the above scripts are just examples so please get the proper scripts from your analytics service/software.

By splitting up the tracking script in the above manner, this allows you to use body section of any page to set any custom event or custom variable settings.

Please refer to the appropriate help manuals on how to properly setup your tracking scripts for custom events or custom variables.

If you require assistance with custom implementations of Google Analytics or Omniture SiteCatalyst, please Contact Us.

Facebook DZone It! Digg It! StumbleUpon Technorati Del.icio.us NewsVine Reddit Blinklist Furl it! Subscribe RSS Twitter

Post a comment!