Tuesday, September 14, 2010

Tracking email marketing campaigns

While working for NatNif.com project, I had to track the emails (in fact XMas greetings) sent by people to others, whether its viewed, whether the viewer has signed up at NatNif.com or no..

Tracking whether the email is viewed

This is possible only if the mail format is HTML. Tracking is achieved by placing a 1X1 image pixel in the body of the image, which carries a unique id for the email to the particular recipient.

The major threats here are,

1. Images get displayed only if you allow them in display while viewing the email message.
2. You cannot embed a pixel in this way i.e . Most of the spam filters will remove such dynamic URLs present in image tags.

Out of the above 2 , we do not have any control on the first one. Second one can be solved replacing the dynamic image URL with a innocent looking URL like ‘track-3454.gif’ . I have used Apache’s mod rewrite to process these innocent looking image URLs and take out the id from it and do the tracking.

Next thing which need to be taken care is the links present in the body of the email messages. We can create links with URLs like

http://www.mysite.com/track.php?id=3454&dest=http://www. mysite.com/actual-destination.html .

So here instead of keeping a direct link to

http://www. mysite.com/actual-destination.html

, we are goinging to the tracking page, which tracks the link clicked and finally shows the real destination. In the tracking page, using the id in the link, we can find out which recipient has clicked and come to the site.

If you have any more related info, please feel free to share.