Email Tracking - GMail

十年热恋 提交于 2019-11-28 04:45:41

Are your images requested with HTTP or HTTPS?

If so, that's the problem.

HTTPS->HTTP referrals do not leak a Referer Header (HTTP_REFERER).

If you embed a HTTP hosted image in an email that is requested from an HTTPS page, it won't send a referrer. (HTTP pages requesting HTTPS, however, do send a referer).The solution is to embed the image as HTTPS. I've tested it, and sure enough, secure HTTPS images do indeed send the Referrer.

One way Gmail could block the referrer information on loaded images by default is if they used a referrer policy, which is supported on most modern browsers. (As of 2011, they did not implement such a policy.)

See the below screenshot of an embedded image that is generated dynamically with the HTTP REFERER of the request:

Make the link something like http://www.example.com/image.jpg?h=8dh38dj

image.jpg is a PHP file and 8dh38dj is the hash of the email you included the link in. When the user requests the file, your PHP script will get '8dh38dj', look that up in your database and find the matching email. Parse the domain i.e. gmail.com from example@gmail.com and you know it is from gmail. To make jpg files execute as PHP, use an AddHandler in php

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