poMMo
poMMo copied to clipboard
Link tracking with google analytics
I'm currently setting up a click tracking system using google analytics : the goal is to be able to track any clicked link on mails (either pointing to your website or to another website), and identify the subscriber ID and campaign ID.
I rewrite URLs in sent emails so that it goes through PoMMO for tracking, then redirects to the desired page.
Here is an example : Your PoMMO is running on http://mailing.mydomain.com, and you want to display a link in mails pointing to http://www.youtube.com/myvideos :
- The click tracker will turn http://www.youtube.com/myvideos into something like http://mailing.mydomain.com/tracker?utm_source=pommo&utm_medium=email&utm_content=http%3A%2F%2Fwww.youtube.com%2Fmyvideos&utm_campaign=42 .
- Whenever that page is visited, the Google Analytics code will be loaded, and when it has finished sending informations to google, it will automatically redirect to the desired http://www.youtube.com/myvideos .
There are two way to do that redirection system :
- Load the Google Analytics javascript, and then do a javascript redirection. pros : collect all the data. cons : does not work if the user does not have javascript.
- Use Php-Ga to send analytics data without relying on javascript. pros : instant redirect, no browser history. cons : some missing data (geolocalization, screen size, etc ...).
I added those lines in the config file :
::: Click Tracking :::
[analytics_tracking] = js off, js, php
[analytics_tracking_id] = "UA-XXXXXXX-X"
[analytics_tracking_domain] = "mydomain.com"
I will keep you updated with all that.