Normally, a link’s HTML code looks like the following.
If you are using Google Analytics, you know that you can easily see what site is referring traffic to your site. But how do you use Google Analytics to track traffic flowing the other way? One way you can do so is by calling the ._trackPageview() method in Google Analytics’ pageTracker object. For example:
Now whenever someone clicks on the World War II History link, it will be tracked as a normal visit to a particular content page. To see this data, log on to Google Analytics and go to Content, then Top Content, and finally search for all URLs containing the word “outgoing”. By the way, you can name these mock content URLs whatever you want. I chose to use the word “outgoing” because no other pages in my site contains the word “outgoing”, thus making it easy to distinguish between normal content and outgoing content.
Updated code based on Google Analytics changes: