menu
Event Tracking
Monitor file downloads, and banner or exit clicks

What is Event Tracking?

By default Web-Stat measures the traffic on all pages that contain the Web-Stat code. This works great most of the time but there are a two important cases when this is not enough :

  • Tracking of multi-media and other files : you can not edit non-HTML documents (like music, videos, PDF, or images) to add the Web-Stat code so the loading of these files can not be tracked directly. Web-Stat's Event Tracking allows you to overcome this limitation

  • Tracking of clicks leaving your site : some people have ads on their site that lead to pages outside of their control - if you sell banner ads for instance - in a case like this you might want to measure the number of clicks that each banner receives. Since you can not install the Web-Stat code on the target site to measure the page views, you need an alternate solution. Web-Stat's Event Tracking does just that

How does it work?

In the cases above we are trying to detect the loading of documents on which the Web-Stat code can not be added (either because the document is not an HTML file, or because it is outside of our control). Since we can not add the code to the document we can not directly detect its loading in the visitor browser, however what we can still do is detect the click on a link to that document. 'Event Tracking' is the ability to record that click, as opposed to the default behavior of Web-Stat which detects page loads. So basically we are now detecting clicks towards a target file as opposed to the actual loading of that file.

So, to give an example: if your visitor sees a link on your site that says 'Listen to My Music' and clicks on that link, Web-Stat will detect the click and show a 'page view' for the music file.

Use Event Tracking on your site

Let's take two examples : in the first you want to measure the download of an MP3 file on your site (the same principle would apply for any kind of file download). In the second example you want to track clicks to an outside web site.

example 1: track the downloads of an MP3 file

Configuring a link for detection is a simple matter of editing the HTML '<a href...' code for that link and adding a new parameter to it. Let's assume that you have a link on your page that people click on if they want to download (or listen to) an MP3 music file. Right now your HTML link to that MP3 file looks like this:

<a href="/my_music.mp3">Listen to My Music</a>

To enable Event Tracking for the link, simply modify it like this:

<a href="/my_music.mp3" 
onClick="return wtslog6('####','#',this,'my_music','conversion_number');"> 
Listen to My Music</a>

Anyone clicking on the link will now generate a page view in your stats for a page named my_music. This will appear in the click paths reports and in the page views report.

Note 1: the string #### is a placeholder. It MUST be replaced by a code specific to your account. See the bottom of this page for further instructions.

Note 2: the string my_music can be anything you wish: whatever you use in its place will be used to identify the click on the link inside the stats.

Note 3: the conversion number is optional. Use it if the click on the link constitutes a conversion. It must be a number between 1 and 5.



example 2: track a link to an outside site

In this case we start with a link like this:

<a href="http://www.some_site.com/some_page.html">Go to SomeSite</a>

To enable Event Tracking for the link, simply modify it like this:

<a href="http://www.some_site.com/some_page.html" 
onClick="return wtslog6('####','#',this,'click_to_somesite','conversion_number');"> 
Go to SomeSite</a>

Anyone clicking on the link will now generate a page view in your stats for a page named click_to_somesite. This will appear in the click paths reports and in the page views report.

Note 1: the string #### is a placeholder. It MUST be replaced by a code specific to your account. See the bottom of this page for further instructions.

Note 2: the string click_to_somesite can be anything you wish: whatever you use in its place will be used to identify the click on the link inside the stats.

Note 3: the conversion number is optional. Use it if the click on the link constitutes a conversion. It must be a number between 1 and 5.



As you can see, all you need to do is add the 'OnClick' element in red inside the link that you want to track and Web-Stat will take care of the rest.

Important ! three things are needed for this to work :

  1. The standard or advanced version of the Web-Stat code must be installed on the page that contains the link (for a Flash site, simply add the code to the HTML container). The simplified version of the code will not support Event Tracking

  2. You must be using version 6.0 (or above) of the Web-Stat code. To get the latest version click here

  3. The 'OnClick' element must reflect your account's details. Please enter your user ID and password below and we will display The 'OnClick' element for your account

Get the Event Tracking code for your account

You are now ready to start using Event Tracking on your site. Please enter your login information below and we'll show you the exact code to use on your site


user ID
password