Creating Google Analytics Goals for Off-Site Links
2 Comments Published by boris March 11th, 2009 in google analytics, technologySometimes you might want to setup a Google Analytics Goal that is actually a link to an off-site url. For example, you conversion page might be on a different domain, but you want to be able to track users who click though to it as completing a goal.
We recently launched a WordPress MU blog network called Au Pair News and wanted to track when people click on certain off-site links (such as our “View Available Au Pairs” page) as having completed a goal. Google Analytics allows you to do this with a 2 step process.
Step 1: Track a Page View For Your Links
Even though your link is off-site you can still track a virtual page view for it by using the pageTracker call. So for example, we might have:
<li><a href="http://www.culturalcare.com/hostfamilies/availableaupairs/" onclick="pageTracker._trackPageview('/avaaupairs/');">View Available Au Pairs</a></li> |
Google will now track the /avaaupairs/ page in my aupairnews.com analytics account. (Learn more about trackPageview)
Step 2: Setup your Goal
Now that /avaaupairs/ is showing up as one of the content pages in Analytics, we can create a goal based off it. Because we’re operating a blog network where the subdomain is different for each user, our goal is setup as a Regular Expression with the goal url /avaaupairs/ (but if you know the full path, you could use an exact match or a head match as well).