Email tracking techniques in php

旧街凉风 提交于 2019-12-02 19:40:29

The tracking image must not be sent as inline with the email, as what you are counting, to keep track of people who opened your newsletter, is the number of times that image was downloaded / requested from your server.

This means your tracking has a URL that looks like this :

http://www.yoursite.com/tracking.php?id_newsletter=X&user_id=Y

Note, though, that this will only work for users who choose to enable the display of images while looking at your newsletter -- and more and more e-mail clients disable images, by default.


Other tracking solutions ?

Instead of tracking number of views, you could track number of clicks on links.

For example, instead of having a direct link, in your newsletter, that would look like this :

http://www.yoursite.com/destination-page.php

The link would point to a counter / tracking page :

http://www.yoursite.com/track-clicks.php?newsletter_id=X&user_id=Y&destination_page_id=Z

And that track-clicks.php page would :

  • insert some data to the database (or somewhere else), to keep track of the click
  • select from the database (or elsewhere) the URL of the page that corresponds to destination_page_id=Z
  • redirect the user to that page.


Tracking clicks, instead of views, has several advantages :

  • Even if the number is smaller, you are not tracking users who registered a long time ago and are not interested anymore : you are only keeping track of users who are interested enough to read your newsletter and clicks on links
  • This should works much better : even if external images are disabled, users will have to click on your tracking links to access the page that interests them

You can only reliably track opened emails by using an image loaded remotely – ie. from your server. (Even then, mail clients probably block remote images by default)

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!