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 :

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:

Please log in to get the code for your account

Log In

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 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 2: 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:

Please log in to get the code for your account

Log In

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 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 2: 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 inside the link that you want to track and Web-Stat will take care of the rest.

Important! 3 things are needed for this to work:

  1. You must have a Premium account (free accounts do not monitor Page Views, so they can not record a click event). If needed you can upgrade here.

  2. The standard or advanced version of the Web-Stat code must be installed on the page that contains the link. The simplified version of the code will not support Event Tracking.

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