Jump to content

Recommended Posts

You can put an image in your email and the image src will point to a php (or other server-side language). You will send out the emails with a unique id generated for each email, to be put as a param in the image src url. For example,

 

email 1 gets: <img src='yoursite.com/tracker.php?id=1' width='1' height='1' />

 

email 2 gets: <img src='yoursite.com/tracker.php?id=2' width='1' height='1' />

 

etc...

 

dunno what system you are using to send out these emails, but a lot of mass mailer/mailing list programs have the ability to auto-generate a number like that.  Or you could write up your own basic emailing script and inject it yourself.  Or hack an existing one, whatever.

 

When the user opens the email, the image request will be made to your tracker.php script.  Your tracker.php script will grab the id, and record the viewing in a database or flatfile.  It can be as simple as a single column of ids, as they come in.  That way you will have a list of all ids of emails viewed, and can compare that to your overall list. 

 

The tracker.php will then, as a response to the email image request, output a raw image. Just a simple 1x1 transparent pixel.  Or, if you are already going to have another image in your email somewhere, you can have it output that, instead. 

 

You will have to accept a margin of error, because while most email providers do allow images, a lot of them ask the user if they want to view them, or the user can flag in their settings to never view images.  Can't get around that.  A lot of people put a "click here if you have difficulty viewing" link in there, to try and get the user to click on that link and go to a live webpage version of your email.  Passing the unique id in the link and tracking it there.

 

 

Link to comment
https://forums.phpfreaks.com/topic/180063-tracking-email-sent/#findComment-949924
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.