Question

In order to track email open rates, I'm firing a pixel in a mass email I'm sending from my server. The script is working in Mac Mail. The email is received and the pixel is downloaded.

However, it's not working in the Yahoo mail client. The email is received, the referenced images are downloaded and shown, however the pixel does not fire/download, nor does the php script run (to my knowledge). Does anyone know why this would happen with Yahoo mail client and potentially other clients that I have yet to test?

Here is the html img tag:

<img src="http://mysite.com/email_track.php?email=email_value&country=country_value&state=state_value" />

Here is the php script:

<?php


// Database code omitted

$result= mysql_query("INSERT INTO `CelebrationOpens` SET `time` = NOW(), `country` = '$country', `state` = '$state', `email` = '$email' ") or die(mysql_error());

// Create an image, 1x1 pixel in size
$im=imagecreate(1,1);

// Set the background colour
$white=imagecolorallocate($im,255,255,255);

// Allocate the background colour
imagesetpixel($im,1,1,$white);

// Set the image type
header("content-type:image/jpg");

// Create a JPEG file from the image
imagejpeg($im);

// Free memory associated with the image
imagedestroy($im);

?>

I've also tried to fire the pixel like this:

$name = './concert/pixel.png';
$fp = fopen($name, 'rb');


header("Content-Type: image/png");
header("Content-Length: " . filesize($name));

fpassthru($fp);
exit;
Was it helpful?

Solution 2

I was able to find the culprit, and it was related to caching the pixel link. I appended a random string to the img src and it works in both ymail and gmail now.

The image tag now looks something like this:

<img src="http://mysite.com/email_track.php?email=email_value&country=country_value&state=state_value&random_value=<?php echo rand() ?>" />

Thanks for the help in guiding me towards this discovery.

OTHER TIPS

You mentioned you are using all embedded images, which is why they always show, independently of whether you opt to download images for your email. Embedding images is the workaround for image blocking, but results in a large filesize for the email.

All non-embedded images need to be shown to work. Your tracking pixel is one. Apple clients download all images by default, while other clients do not. The tracking image is not firing because you haven't downloaded images on your email in Yahoo (or any other client).

Unfortunately this is a limitation to open tracking and why the data is incomplete and always skewed towards Apple clients. Open tracking really means 'They opened it and unblocked the images OR They opened on Apple'.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top