NetTalk Central

Author Topic: Tracking email opens  (Read 3438 times)

JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email
Tracking email opens
« on: September 02, 2013, 05:27:52 AM »
Hi,

I am using a nettalk procedure to send emails to a list of clients/account holders with important rate updates.
In the mail I have a link that they can click for confirmation, but thought I might want to take this a step further.

Thinking is to track the reading of the email, using an embedded link to NTWS procedure,
each mail will be unique and the link in each mail will have an unique id.

I realise that some mail clients block images, so there will be a loss of function in those cases.

Has anyone else done something similiar?
Same method or is there another way to do this?

Was hoping for any feedback.


thanks

Johan



bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: Tracking email opens
« Reply #1 on: September 02, 2013, 05:43:07 AM »
Hi Johan,

Most approaches use an image that is embedded within the email and the downloading of that image is the trigger to updating the read count.

So the client does not need to click on any links, but they do need to request images be downloaded (in the event their email client blocks images by default)

The image filename you use needs to identify the clients Id.

You can either add it to the end of an image filename, eg:

/tokenimage.png?id={id}

You can also mess with the ID to confuse people who might wanna screw with your system (like Bruce does with the primary key when going from a netwebbrowse procedure to a netwebform).

You can also do it as part of the filename:

/tokenimage_{id}.png

NetTalk will fail to find the image so use the _SendFile procedure in WebServerHandler to decode the filename, then send the actual image (which is usually just some boring static image, we use our logo on the footer of the email for this purpose, but it could be anything)

The image filename should be appropriate obtuse not to conflict with real images in your system.

Regards
Bill

JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email
Re: Tracking email opens
« Reply #2 on: September 02, 2013, 10:07:42 AM »
Hi Bill

thanks for the reply,

perhaps I am missing something but seems this is what I have to do to get it working.
I am using NT to send the mails if the image does not exist it croaks,
so will create an image for every mail being and then somehow bypass the embed images function when sending the mail for this specific image

At the NTWS intercept the request for the image file and log the action.

Is there another way perhaps without creating an image for every mail?

thanks

Johan


bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: Tracking email opens
« Reply #3 on: September 02, 2013, 03:59:11 PM »
Hi Johan,

I don't use NT to send my emails, so im uncertain about how that might constrain you.

Your image will need to be a simple link, it will not be an embedded image. Your email will just need something like this in it somewhere:

<img src="http://myhost.com/TokenImage_{ID}.JPG" />
or
<img src="http://myhost.com/images/TokenImage_{ID}.JPG" />
or
<img src="http://myhost.com/virtualimages/TokenImage_{ID}.JPG" />


Now, the token image will not exist, it cannot as the filename will change based on the customer.

However the fabulous thing about NT is you control the server, so you can get NT to send them an image if you want to.

So, lets assume we implement the _SendFile trick i mentioned, when you go to the URL you chose above, the image will actually appear.
Even though I don't know how NT does emails, i'm sure it can allow an external images link, such as my examples above.

You may have other images you want NT to embed, and thats fine you can mixed the two type of images (embedded and external).

The only trick to master is intercepting the p_Filename within the _SendFile procedure and calling the PARENT _SendFile procedure with the filename replaced with whatever static image you will be sending to the client (remember this image doesn't matter, in fact many old systems used a 1x1px image, but as mail clients got smarted they realised this, so i'd suggest using an image that is part of the overall message eg. a logo or something).

At the place where you intercept the p_filename you also record your statistics. You can also log the IP if you want to count unique reads etc, but all that is easy once you get the basics working

Regards
Bill

JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email
Re: Tracking email opens
« Reply #4 on: September 02, 2013, 10:00:18 PM »

Hi Bill

thanks!
I think the penny dropped.

An idea I am going to try is after NT embeds the images will insert the link into the mail to the image.
but I think I understand what to do on the webserver side.

Johan