2

I know a few companies that were able to do this sort of tracking, and most techniques that were discussed are advanced web bug. But what exactly are behind the scenes? I've seen people claiming they use long loading image, or redirect techniques to track, even though it was not very accurate, but still good enough. Just wonder if any one have some sample php codes of doing that or some clear logic?

Thanks.

xbb
  • 2,073
  • 1
  • 19
  • 34
  • 6
    Color me skeptical... Modern email clients go far out of their way to prevent loading external css, images, or scripts, or anything else which enables a web server to spy on when and how an email is read. – Michael Berkowski Aug 01 '12 at 20:39
  • 2
    Don't be. I've got a nice bit of jQuery that can detect user farts (length and volume) in chrome and safari... – Giovanni B Aug 01 '12 at 20:40
  • It is possible I suppose, if your email had lots of links, to track the click times between them on the target web server, but that assumes the reader clicks any, and that's about as far as my imagination takes me. – Michael Berkowski Aug 01 '12 at 20:41
  • 1
    "we" track open with the embedded image 'trick' and all link clicks. That's the limit. –  Aug 01 '12 at 20:42
  • 1
    i think all 3 answers below are impractical, at least from a commercial stand pint. –  Aug 01 '12 at 20:48
  • @Dagon Can you expand on that comment? From what I see, all three answers advice against doing it, and discuss the only possible way to do it (web bug) which you yourself say "we" use. What, exactly, is impractical? – Chris Baker Aug 01 '12 at 21:08
  • most didn't say here's an option but its a bad idea when i posted, just "here's an option". Regardless i think its a bad idea to post bad options even with disclaimers. –  Aug 01 '12 at 21:14

4 Answers4

8

Other than a read receipt (gmail, outlook/live), there is no sure-fire way to track whether an email has been read. One could use a "web bug", but an email client that disables automatic loading of images (as most modern ones do) will defeat this method, as would caching, some firewall settings, etc (for examples, see section "Insensitive Pig").

A long-loading image is possible, but again the accuracy depends on a factor you cannot control -- if the email client cancels its request for the image when the user unloads the message. A client may not do so, it may allow the image to "complete" in the background.

With PHP, one would accomplish a long-loading image by sending the image headers, then sleeping a short time, recording the fact that the request is still open, then sleeping again.

Very roughly, this is what such code would look like:

session_start();
function recordViewTime () {
    /* 
        the difference between $_SESSION['_image_start_time'] and 
        $_SESSION['_image_active'] is, theoretically, your email view time
    */
}

register_shutdown_function('recordViewTime');
header('Content-Type: image/jpeg');
$_SESSION['_image_start_time'] = microtime();
while (true) {
    $_SESSION['_image_active'] = microtime();
    sleep(1);
}

Obligatory Disclaimer

Users generally don't appreciate this kind of practice. Especially given the current environment for online privacy that sites like Facebook and Google have created by their policies, users are more sensitive and educated than ever about who collects what information and how it is used. Using any kind of hidden or secret method to track user activity on the client side may have negative repercussions should your user tip to the activity.

The value in knowing the effectiveness of your email marketing is high, so the temptation is great, but just understand that the trends in privacy and security related to privacy are building against using this type of practice.

Documentation

Chris Baker
  • 49,926
  • 12
  • 96
  • 115
3

There is only one way I know to do this, and it's fairly advanced to set up. Basically you put a webbug in place which never finishes loading, then track how long the user attempted to download it. You have to send some new data every few seconds or the remote end might just time out.

This is not recommended for many reasons. In addition to ethical ones (which I won't cover here), there are several technical reasons it's not recommended:

  • Users who have a caching proxy between them and the web bug server won't give you accurate results. The proxy server will be the agent performing the request, and it may sit there slurping up data for much longer than the user actually has the email open.
  • Mobile users may burn a lot of battery and/or bandwidth if they leave the email in the forefront and turn off the screen (most mobile devices will try to preload the images if they are going to show them).
  • Having an email open and reading the email are not the same thing, someone could leave your email open in their preview pane all day, and maybe they weren't even present when the email came in.
  • Most modern mail clients block images by default, so like other web bugs, this is likely to cover only a small portion of your users.
MightyE
  • 2,679
  • 18
  • 18
0

FYI: An Answer from SuperUser and another from StackOverflow also addressed this same issue (to an extent). Also it talks about what happens behind the scenes.

(Shows code) Track mass email campaigns

https://superuser.com/questions/290568/how-to-track-if-email-was-read

A website that offers the ability to track the type of things you are mentioning is:

http://www.didtheyreadit.com/ (VERY finicky from what I gather)

I looked this over and it seems like a decent enough application. The below website is a review from about.com with roughly 3 out of 5 stars on the subject.

http://email.about.com/od/windowsreturnreceipts/gr/didtheyreadit.htm

Also, please do remember that just because a page was open for a few seconds or an hour does not mean they did not or did actually read it all. This is more of a measure of when the e-mail was opened and how long it stayed opened for.

This is only 1 example of what there is out there but it does hopefully help you determine what to look for.

Community
  • 1
  • 1
Patrick
  • 197
  • 2
  • 4
  • 13
-1

You could use an iframe inside the email, pointing to the mail content in your website. You can place there a script to count the reading time.

http://www.campaignmonitor.com/blog/post/3219/do-iframes-work-in-email/

If the email client doesn't support iframes, you can place a link like:

if you can't read the message, click here

. And redirect to the iframe content.

Pedro L.
  • 7,376
  • 3
  • 25
  • 27