Email gif tracking / PHP question

wezcountry

New member
Aug 31, 2009
1,788
22
0
In the EUSSR
Hi guys

a client wants to track email opening rates using a gif sent in the email.

However he says it's possible to construct the gif URL to be a link to a PHP script which will take the client id, store that in a DB, and send back the gif image.

I've not heard of this before and he can't give me an example. Can anyone tell me how this works? Is it possible to run a php script from an email? Won't it be blocked by the email service?

I've done some reading but I can't find any info ... basically because I don't really know what I'm looking for.

Sorry if this is an ultra-newb question !

Wez
 


Just use mod_rewrite or something to it appears to be a GIF. So the URL domain.com/images/tracker.gif actually points to /tracker/email.php on the server.

Then inside email.php, use:

Code:
header("Content-type: image/gif");
echo file_get_contents('image.gif');
exit();
Voila!

EDIT: When the image doesn't display properly, and you can't figure out why -- it's because you have blank lines at the beginning or end of one or more of your PHP scripts.
 
Just use mod_rewrite or something to it appears to be a GIF. So the URL domain.com/images/tracker.gif actually points to /tracker/email.php on the server.

Then inside email.php, use:

Code:
header("Content-type: image/gif");
echo file_get_contents('image.gif');
exit();
Voila!

EDIT: When the image doesn't display properly, and you can't figure out why -- it's because you have blank lines at the beginning or end of one or more of your PHP scripts.

That's really clever. thank you.
 
Years ago I used to do it like this for the company that I used to work for...

<img url="http://meatspin.fag/signature.gif?[emailaddress]">

The contact's email address is inserted through merge fields of the email software.

Then I used to use an email harvester on the server log files to pull the emails. It was mostly for tracking # of opens. This is a much more manual solution than above though.
 
Why not use someone like Sendgrid to send and track the emails? They insert some tracking into the emails that tells you when each person has opened the emails, etc.

Not sure if that's exactly what you're looking for though since you mentioned the gif. Hope it helps, anyway.
 
Why not use someone like Sendgrid to send and track the emails? They insert some tracking into the emails that tells you when each person has opened the emails, etc.

Not sure if that's exactly what you're looking for though since you mentioned the gif. Hope it helps, anyway.

Hi thanks. Client requested us to build a mailshot solution into an existing app, which we've done. Now he wants to improve reporting.

I am thinking of going for something like embedding a call to a php script disguised as a gif url, with campaign and contact ids embedded. PHP script writes the data and sends back a gif. Something like that !