How to use _trackPageview in Google Analytics
Author:
Nick Rinylo
SEO Videos
Today, we’re going to take a look at the simplest way to use the Pageview Tracker aka _trackPageview feature in Google Analytics. I’m joined by Luci Smethurst, one of our senior web designers.
Pageview Trackers let you record hits in Google Analytics on elements that are contained ‘within the page’. For example, the number of times a link to a download is clicked, the amount of clicks on a specific button, or infact any javascript controlled event such as jQuery Tabs, Show/Hide Sliders and ‘One-Page’ Wizards.
Variations of the _trackPageview Code
- Tracking Link Clicks: <a title=”Name of Link” onclick=”_gaq.push(['_trackPageview', '/linktype/linkname']);” href=”http://www.domain.co.uk”>Name your Link</a>
- Tracking Button Clicks: <input onclick=”_gaq.push(['_trackPageview', '/submit/contact-form/']);” name=”submit” type=”submit” value=”Submit” /></code>
- Tracking an Impression: <script type=”text/javascript”>pageTracker._trackPageview(“/page/impression/”);</script>
You can also setup Goals specific to your Pageview Trackers; E.G. Tracking the user behaviour and conversion rate of ‘One-Page’ Checkouts and Contact Forms, useful for quantifying the success of SEO Campaigns. Not sure on how to setup a Goal? Checkout our blog on Goals in Google Analytics.
There is one thing to warn about. By using an extra Page Tracker, as GA tracking is already in place – your Analytics of course will show 2 hits instead of 1 for the same page. It all depends on what you’re tracking, but this could result in your GA showing inaccurate data. You can curveball this issue by using an alternative Event Tracker.
