Link to home
Start Free TrialLog in
Avatar of peps03
peps03

asked on

Track if sent email has been opened

Hi,

I'm trying to figure out a way to track if a sent email has been opened.
This could done with a tracking pixel, but i don't know how it works.
The emails that are sent are customized emails that load external images from a remote server.

What would be a good way to do this? I believe some kind of fairly easy trick to accomplish this exists, so i don't want to use any external software, i'd rather build it myself.

Thanks!
SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
As stated, most modern clients will not automatically open images.  There is NO foolproof method that will confirm OR deny that an email has been read.

The commenest aproach if you MUST confirm read of an email is to have the email content stored on a web site somewhere and just email a link to the end user that allows them to go read the content. Once they hit your website, you know that they have landed on the email.
<img src="path/to/images/loadImage.php?emailID=123456" />

If I was sent an email with that in it my filtering would strip it, and I would log an advisory to block the ip of both the email server and the domain where the image is hosted.

You are treading on thin ice when you try to track user activity on their own computer.

Cd&
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I really need to start writing shorter posts. Two other people posted in the time it took me to write that last one.
@COBOLdinosaur, better?

<img src="path/to/images/123456/imageXYZ.jpg" />

Open in new window

Avatar of peps03
peps03

ASKER

Thanks all!
So the php file will contain a piece of code that adds +1 to the userid in the db.

Will it also contain a piece of code to display an actual image?
like a base64 type or something?
@COBOLdinosaur, better?

The image still gets blocked and the ip of the mailserver and hosting domain are recorded.  It would not trigger an immediate advisory in the logs, but if the number of mails from the ip reach an alert level then it would trigger a blocking advisory.

Cd&
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of peps03

ASKER

hmm oke.
i almost get it, i think.
would i put the path to the real image in the loadImage.php file?

and can i use this technique with every image? like the logo in the email header?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
My own $0.02 - COBOLdinosaur's filtering sounds a little more overprotective than the typical mail user. Most users will hardly adjust the spam filtering with the slider bar in Outlook, much less have rules that process content, and most users are not behind custom mail servers with tuned server-side rules. A lot of home ISPs leave spam filtering rules wide-open and many business servers simply trust the default rules from their security appliance manufacturers. This means that the majority of server-side filtering is not changed.

That still doesn't change the fact that most people won't activate the tracking pixel.

leakim - no need to use GD to generate a blank pixel. You can use readfile() to stream the 50 or so bytes from an existing blank pixel GIF. It's much less resource-intensive.

peps03 - you only need to do it once per email.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Most users will hardly adjust the spam filtering with the slider bar in Outlook, much less have rules that process content, and most users are not behind custom mail servers with tuned server-side rules.

Very true. I have a dozen emails accounts and the incoming gets auto forwarded to my server and everything gets parsed with PHP before it makes it to my client.  The script has a white list in db table and I can set specific rules right down to individual email addresses.  So stuff coming from my bank or brokers allows images, because I want the graphs them sometimes include.  The point of filtering is more about getting good emails in the right folders as much as it is dumping the crap.  The important side is the whitelist to make sure you get the important stuff.

Cd&
Constant Contact and all of the other email services use both tracking images and 'click-thru' links that go to their servers first before being redirected to their destination.
@gr8gonzo. You posts are intimidating ;-)

Maybe it has been said already, but I've modified my apple mail client with secrets to send me an email when the reading has of my sent email has been confirmed. That is less a tracking. It requires the user to actually click on a dialogue in their email-clients, but it will tell you that your user has read the email.

So if apple mail can send along this information you can do also within your headers of the email.

For the reading confirmations:

X-Confirm-Reading-To: <address>

For delivery confirmations:

You have to add the Disposition-Notification-To header.

RFC 3798 Standards reading
@DaveBaldwin - Yes, many of them do that, but they also have an entire application to support data analysis, and a higher delivery rate due to proven anti-spam self-regulation. Higher delivery means increased actions from users (more clickthroughs and more tracking pixel activation).

Trying to rely on tracking pixels alone as an indicator of open rates is just not a good idea. As padas and I both said, clickthroughs is typically a better way to go (unless you happen to have content that users are going to be desperate enough to WANT to read that they'll enable the remote images).

@mcnute - Intimidating? :) I'm sorry - that's never my intention. If I ever disagree with someone, it's purely for constructive purposes. This is a learning site, so I try to include as much detail and context as possible.

That said, delivery confirmation will be kicked off as soon as the email is delivered to the user's mail server, not their mailbox. Failed delivery confirmation is a good way to weed out bad addresses from a mailing list, but not an indication of whether or not the user has actually even seen the message.

The Confirm-Reading-To works pretty well when you know the recipient and they WANT to explicitly notify you that they read it (great for business comm). For mass mailing, people tend to click the "No" button, meaning that you never get confirmation, even if they continue to read it.

The other issue is that it's harder to process the confirmations. With tracking images and click-throughs, the user is going straight to a script. Confirmation emails, on the other hand, come in the form of email messages. That means a separate process needs to download the confirmations from a mail server, process the email, and then finally perform the database changes to indicate a mailing has been read. This CAN be done, but if a user is going to click on your email message anyway, it's often better to try to drive them to a web site where you can then perform a more thorough attempt at a conversion.
Avatar of peps03

ASKER

Thanks all for the reactions.

I'm still not exactly sure what the php file will look like..

Will the file produce a gif image or should a 1px transparent gif image be loaded into the file?
I meant just for their length. I havn't read your comment, because it's so long ;-)
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Dave's correct - sorry, I rushed through that script a bit.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@mcnute - :( Yeah, my comments are long, but I try to make them valuable...
Avatar of peps03

ASKER

@gr8gonzo, thanks for the explanation.

You said your code isn't very secure, how could i secure it better?

And again, don't do the tracking pixel.
Why? It could give me some additional info.. i also track links inside the email. The combination seems better than only 1 of the 2.

so the image code in the php script will look like this:
// Now display the transparent pixel
header('Content-Type: image/gif');
readfile("pixel.gif");
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of peps03

ASKER

Thanks for your reply again!

I use 7 random generated big and small letters as id.
And the tracking is only for a few sent emails at a time.
So i think that is covered.

I still have some trouble adding +1 to the db table. It works fine when i load the url of the php file directly into the browser, but is seems to only work once from an email client.
If the images are loaded again, +1 is not added.

Could it be the php file is cached by the email client / browser or something?

Is there a way to prevent that?

AND sometimes the image is not loaded.
You have been told repeatedly that this is unreliable.  So now you are seeing it on a mail client you control; think about it on clients you don't control.  The information you get will not be accurate no matter what you do.

Cd&
Avatar of peps03

ASKER

@COBOLdinosaur, don't get mad at me.. just asking.
i fixed it thought, the mail client cached the url.
Avatar of peps03

ASKER

Thanks all for the help. Nailed it!
As the emails that are sent already contain 3 external images, i believe its no problem to add 1 more for tracking.
And, i'm also tracking the links, so combined i'll have some more info than none at all.
Happy tracking!