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.
pageTracker._trackPageview(’/outgoing/google.co.uk’);
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
Another way of tracking these events is to use event tracking, which is different to a page view. With event tracking you call the _trackevent() Javascript call within a link. This allows you to add the following attributes to a link
- 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’.
1 2 | <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.










I like this! A client asked me the other day if there was any way of finding out which PDF brochure had been downloaded from his site, this could be a way of doing it, although probably not the solution he is looking for.
Hi Julie,
I would say that this is the perfect way to track the download of a PDF. You should track the link as a virtual page view perhaps using the subfolder /PDF/ to indicate that it was a PDF download. This way you can view all PDF downloads very easily in Google Analytics, you could even add one of the virtual page views as a goal to view conversion rates of this download
Thanks for this Paul.
Recently started using pageview to track some external links on a website. But like you said, it increases my pageview in an annoying way and now webmaster tools is saying that a missing page (404)! Is there anyway to avoid that?
Hi tola,
If webmaster Tools is stating that you have some 404 pages this means your site has some dead links. You need to ensure all links are pointing to the correct pages. Zenu Link Sleuth is a good tool for doing this.
Leave your response!
About Me
Paul Spreadbury
I am an Internet Marketing Professional with over 6 years experience in search engine optimisation and internet marketing. I work as the Senior SEO Manager for Just Search, one of the largest SEO firms in the UK based near manchester.
I manage a large team of SEO programmers and provide bespoke internet marketing solutions for a wide range of clients. I have extensive knowledge of SEO, link building and analytics as well as a strong programming skill set. Keep looking back for my latest tips and tricks on everything SEO.
Latest Tweets
Pages
Blogroll
Categories
Archives
Recent Posts
Most Commented
Most Viewed