0

Hi I built an email tracker and it works fine except on Gmail

IMG CODE on HTML email sent

$track_code = md5(rand());
<img src="https://www.syste-mart.com/tracker.php?code='.$track_code.'" width="1" height="1" title="Syste-mart">

tracker.php

<?php
include "conexion.php";
$db = mysql_connect($host,$username,$passwordDB);
mysql_select_db($database,$db);
mysql_query("SET CHARACTER SET utf8", $db); 
mysql_query("SET NAMES 'utf8'", $db);
mysql_query("SET character_set_client=utf8", $db);
mysql_query("SET character_set_connection=utf8", $db);
mysql_query("SET character_set_results=utf8", $db);
mb_language('uni');
mb_internal_encoding('UTF-8');


$code=$_GET['code'];
$ipAddress = $_SERVER['REMOTE_ADDR'];
$fecha=date("Y-m-d");
$hora=date("H:i:s");
if($code!=0){
//This will insert a row each time the email is opened
$inserTrack=mysql_query("INSERT INTO emailTrack (idEmailTrack, track_code, ip, fecha, hora) VALUES ('', '$code', '$ipAddress', '$fecha', '$hora')", $db);
}


echo "<img src='https://syste-mart.com/images/mail.png' width='30' height='30'>";

?>

The error I get in gmail is: The requested URL /proxy/SZKsK8dZS1ZgM4QsOMe78tbq5Pz-2eT5G7rdKoBw6onZwoDU0hOZ4J2qxO06uuEAjh479rICREC3e2PZkbx9yLEAq4RosKVG255lDwkcLYwRgrArBkCJeW1YLYja-v8DKtHoRfh2o1S7TG01eSbhdDEocSDGRSn11SA75z2WzOdMl7XYDB_p3Mywx1xNjzc_4kugvMgKu3-AR9wVRgryZ3Yo4cYanTzENcjf=s0-d-e1-ft was not found on this server

Any ideas? Thanks

Alex G de A
  • 766
  • 6
  • 3
  • 1
    You are open to SQL injections. Don't use `mysql_` anymore. How does the first chunk of code relate? I would just have a `datetime` column. I also don't see any `/proxy/` in either code blocks. – user3783243 Jun 14 '19 at 16:19
  • So, the URL for the pixel, when Google parses it in the email must be resulting in a 404? This might be an issue of surviving transport. Are some of your random strings needing to be encoded differently? – ficuscr Jun 14 '19 at 16:29
  • Would like to see the raw email message. – ficuscr Jun 14 '19 at 16:30
  • The img code is part of the HTML email sent, all the code is working fine in other email providers except Gmail that seems to block outside content (the tracker) – Alex G de A Jun 14 '19 at 16:31
  • They cache the image and load it off their own proxy. Doesn't explain the 404. Was their nothing else on the end of the URI you shared... `d-e1-ft#originalurl.com?foo` – ficuscr Jun 14 '19 at 16:36
  • Hmm. Maybe they did change practices... https://stackoverflow.com/questions/20379732/gmail-blocking-pixel-tracking-1x1-pixel-since-today-morning They want you to drink their cool-aid... https://htmlemail.io/blog/google-analytics-email-tracking – ficuscr Jun 14 '19 at 16:38
  • The complete erro of showing the image is 404. That’s an error. The requested URL /proxy/23LfiZIiQPdNE7G4lZN978HxPexI-VCSCHm3OYO4AKsz-jx3C85r60DzU2xu3VlM2I3yAx-H253SLIg3tWl_3DUvSpKJX1GdNROYKy3gDte4l0LTi5aGDCr2_RjW4K8mlagaanJnfYAc-zaG1GSbzVD5eA2qY6RL8WL96BgZV-PqM2_TadQ9odPEy7yNwOfpdRv3CBboPq4X2GeVmZelREbHIpnoH22LYRXq=s0-d-e1-ft was not found on this server. That’s all we know. – Alex G de A Jun 14 '19 at 16:40

0 Answers0