Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems with tracking pixels and Gmail proxy

I am trying to implement a custom Tracking Pixel for Emails sent out from wordpress.

Thanks to these post:

Tracking email with PHP and image

Tracking email opens with a real image

and especially

http://www.phpdevtips.com/2013/06/email-open-tracking-with-php-and-mysql/

I was able to implement the core idea.

The email loads the tracking pixel via <img src="https://www.example.com/tracking.php?order_id=1" width="100" height="100" />

and in the tracking.php

$graphic_http =  'https://www.example.com/GIF-example.gif';

header('Content-Type: image/gif');
readfile( $graphic_http );

Opening the tracking.php file in a browser opens up the gif image for download.

However the Tracking pixel/Tracking image doesn't show up in the Gmail Email. There is only a broken image logo and when I click to show the image this link is opened

https://ci5.googleusercontent.com/proxy/l2xUKFGnNFKm64zEYmJhOcUmEJm15w9MC1txRRF01tpKlcL3t3O16aMJgbYQkucBySV0xV2T0EsCwikOAC0Z4em6uPzSs38lkHrYBvosRRAk14EfPoEXqC5JdLxRm8ToZmGSQqt_RwHCaBE_3uLgQDVEB05Rdtkq-Xzuw30=s0-d-e1-ft#https://www.example.com/tracking.php?order_id=1

which states a Google 404:

Google 404. That’s an error.

The requested URL /proxy/l2xUKFGnNFKm64zEYmJhOcUmEJm15w9MC1txRRF01tpKlcL3t3O16aMJgbYQkucBySV0xV2T0EsCwikOAC0Z4em6uPzSs38lkHrYBvosRRAk14EfPoEXqC5JdLxRm8ToZmGSQqt_RwHCaBE_3uLgQDVEB05Rdtkq-Xzuw30=s0-d-e1-ft was not found on this server. That’s all we know.

It seems to be a problem that Google's proxy cannot read the php script. Both the tracking.php and the GIF-example.gif files have 775 rights and are accesible publicly.

On Hotmail this does work so it really seems to be a problem with the Google Proxies.

Does anybody know how to let the Google Proxies access this Tracking pixel?

like image 914
MrWeix Avatar asked Jul 06 '16 14:07

MrWeix


People also ask

Does Gmail protect against tracking pixels?

The Gmail app offers a protection feature against some tracking pixels. To enable this, here's the steps: Go to Gmail. Open Settings.

How do I stop emails from tracking pixels?

Click on the Mail tab and select Preferences. Click on the Viewing tab. Check the Load remote content in messages checkbox so that it's disabled.

Can tracking pixels be blocked?

There are a number of browser extensions that will also block the tracking pixels while alerting you to which emails contain trackers. PixelBlock is a simple Chrome extension that blocks images from loading and displays a red eye at the tope of messages when it detects a tracker.


1 Answers

I figured out the answer: The problem was with the Google Proxies and the question mark ? in https://www.example.com/tracking.php?order_id=1

The Google Proxies address got messed up because it already had a question mark and resulted in a 404.

I resolved it using https://www.example.com/tracking.php/order_id=1 instead and then on the tracking.php I didn't use $_GET but $_SERVER['REQUEST_URI'] and parsed the /order_id= String.

The tracking pixel shows up in Gmail and it gets tracked in the tracking.php script.

like image 50
MrWeix Avatar answered Sep 20 '22 10:09

MrWeix