It’s late, but I just finished up a fun little web analytics project that I think a lot of people could use. It’s not very sexy, but especially if you use Google Analytics, read on.
I wanted to track traffic from two sister sites that link back to the main e-commerce site more accurately. I decided that appending some traffic parameters to the links was the way to do it. So instead of having a link that looks like this:
<a href="http://www.example.com/page.html">Awesome Page</a>
it would look like this:
<a href="http://www.example.com/page.html?utm_source=blog&utm_medium=content&utm_content=text&utm_campaign=editorial">Awesome Page</a>
The advantage to having links like this is that they will allow you to collect more and better data. You can learn about building smarter links here.
So I added this to my global footer of the site:
Easy solutions like this make web development a lot easier.
Note: you need to invoke the jquery framework up in the head of your document.