You are here: Home » Analytics » Website Analytics – Various Analytics Tracking Scenarios

Website Analytics – Various Analytics Tracking Scenarios

by Les on November 23, 2009

In general most website owners are interested in tracking data for one TLD – IE:  www.myniftybusiness.com. Simple enough. But what does one do when they have a multilingual site, or a site with multiple domains or subdomains. Things become [a bit more] complicated.

Through this short article I will run through a number of scenarios. Examples will be pulled from Google Analytics (my tool of choice). But the majority of website analytics software will allow enough flexibility so that all activity on your website(s) is captured properly.

Let’s begin with the basics. I have set up a dummy account in Google Analytics with the URL: www.myniftybusiness.com

My Nifty Business - Click to Enlarge

Example # 1 Setting up on a Single Domain

Easy! Just take the code the give you and put it on your site (follow the instructions as to where to put it).

Single Site - Click to Enlarge

Example # 2 One Domain with Multiple Subdomains

This is the same as Example # 1 (above) except you need to take every subdomain into consideration.

Single Site - Multiple Subdomains - Click to Enlarge

Woopra does it too!

Example # 3 Multiple Top-Level Domains

You are a resounding success! You have expanded to all corners of this great world of ours.

Multiple Top-level Domains

Example # 4 – Sites Built for Mobile Phone Access

Now things are getting interesting! Mobile phone use is exploding. Especially outside of North America. Website owners have realized that and have built / optimized their sites to take mobile phone access into consideration (Just for fun access this site from your iPhone or whatnot!). We are now dealing with multiple programming languages (PHP, Perl, JSP & ASPX). You gotta pick one. Also note that you can’t get your JavaScript code insertions mixed up. Do not use desktop tracking code on pages where you use mobile tracking code – and vice-versa.

le Tracking Code

Example # 5 – Sites that Use Dynamic Content

Not all websites are created equal. Dynamic content is a bit more complicated, but can be tracked well if you implement your code properly. My experience has been that the simplest way to approach this is to use a Plugin as most dynamic content providers (such as Joomla!, Drupal, etc…) have realized that everyone wants to track their website’s statistics. For dynamic pages, you can also use a common include or a template to paste the code (as mentioned below in # 6).

Example # 6 – Sites that Use PHP Pages

Different technology = different approach. PHP can be daunting at the start. But implementing an Analytics package should be fairly straightforward. PHP uses what are called “includes“. For any PHP pages, put the following code in a file (for example, myanalyticstracking.php) and upload it to your site. Then, add the following line to each template page before the </body> tag: <?php include_once(“analyticstracking.php”) ?>. Sounds scary. But it really isn’t. This should insert your Analytics code where needed. This example should work with any Analytics tracking package that uses JavaScript tags (other also).

This is not an exhaustive list. But it does touch upon what most website owners will be dealing with.

I was going to mention sites that run on Flash. But have no way of testing my theories. In general tracking traffic on Flash websites has been problematic as Google (and the other search engines) usually only see the site’s splash page and nothing else. All show and no go! However, great inroads have been made of late. Here is a pretty good resource if you are struggling with implementing GA on a Flash site. No surprise that the source of this initiative is Adobe Systems.

Without the Google Analytics Tracking for Adobe Flash component, tracking Adobe Flash content with Google Analytics involves a number of technical hurdles. First, you must develop a custom interface to ga.js so that your Flash application can execute the appropriate Analytics method, such as trackPageview() or trackEvent(). In addition, you must also anticipate whether your Flash content will have access to the browser Document Object Model (DOM), since tracking fails for those objects where access to the DOM is denied (typically when your content resides on 3rd party sites). This involves understanding how to use the ExternalInfterface call in ActionScript 3 to access the browser DOM and to degrade when access is denied.

The Google Analytics for Adobe Flash component simplifies tracking your Flash content and handles DOM access gracefully. It is useful for a number of common tracking purposes in Flash, such as: :

  • an embedded Flash widget on an HTML page
  • a standalone Flex application or Flash-only site hosted on an HTML page
  • a distributed Flex/Flash game or program where the developer has no control over where the widget will be placed

Keep in mind that tracking applications in Flash has some structural variations from tracking website pages. Familiarity with Analytics Tracking is essential to understanding how this plug-in works. You can also view the Design Documentation for this project for detailed information on how the Analytics Tracking model has been ported over for this component.

And remember to ensure that your tracking code has been installed correctly!

Note: Please follow the instructions that your website tracking program supplier has created. Nobody knows their software more than the people who created it! And don’t fiddle with this stuff unless you know what you are doing. Hire someone if you don’t. It will be worth every penny!

Do you feel smarter?

s
  • Share/Bookmark
blog comments powered by Disqus

Previous post:

Next post: