When to use event tracking, and when to use virtual Pageviews
The Google Analytics system allows users to view traffic data when a user physically views a particular page on their website. One problem users can have with Google Analytics is that they are unable to track other actions such as flash animations, downloading on PDFs, or the playing of a particular video.
To achieve this you have a choice of two different features in Google Analytics they are:
- Virtual Pageviews
- Event Tracking
Below I have detailed the different methods of capturing this data within Google Analytics
1. Virtual page views
The first method of tracking such events is using a virtual page view. Virtual page views are a way of faking a page view after a given event, say clicking on a video or an external link. This is achieved by adding the ._trackPageview function to the link. For example if you were to tag an external link to say www.google.co.uk you could use the following call.
When a users triggers a virtual page view the data is passed to Google Analytics and is recorded will all the other page views in the system, it is a good idea to use a strong naming convention to track your virtual page views, which is why in the above example I have used the subdirectory /outgoing/.
One problem with virtual page views is that it can greatly increase your overall page view figures, making it more difficult to analyse data.
The main reason you would use a virtual page view is so you can use the page view as a goal, and track conversions with it
2. Event tracking
- Category – The name you supply for the group of objects you want to track.
- Action – A string that is uniquely paired with each category, and commonly used to define the type of user interaction for the web object.
- Label – An optional string to provide additional dimensions to the event data.
- Value – An integer that you can use to provide numerical data about the user event.
As event tracking allows you to define more variables you can track more information such as page load times, how long a video is played and what buttons a user clicks. For example the below link shows how you could track a video, when someone clicks play, and the video is called ‘gone with the wind’.
<a href="#" onClick=_gaq.push(['_trackEvent', 'Videos', 'Play', 'Gone With the Wind']);">Play</a>
You should be careful to plan which metrics you want to record, this will ensure that the data sent to Google Analytics is actionable. The advantage of event tracking over page views is that event tracking won’t ruin your overall page view data, the only disadvantage is that event tracking cannot be added into a goal which is slightly annoying. The data that you can get from this however is great and provides a huge amount of data to act on.