问题描述
我正在尝试实现从wordpress发送的电子邮件的自定义跟踪像素。
感谢这些帖子:
,特别是
我能够实现核心思想。
电子邮件通过
< img src =https://www.example.com/tracking加载跟踪像素。 php?order_id = 1width =100height =100/>
在tracking.php
$ graphic_http ='https://www.example.com/GIF-example.gif';
header('Content-Type:image / gif');
readfile($ graphic_http);
在浏览器中打开tracking.php文件打开gif图像进行下载。
但是,跟踪像素/跟踪图像不会显示在Gmail电子邮件中。只有一个破碎的图像标志,当我点击显示图像此链接打开
其中规定谷歌的404:
谷歌404这是一个错误。
在请求的URL /代理/ l2xUKFGnNFKm64zEYmJhOcUmEJm15w9MC1txRRF01tpKlcL3t3O16aMJgbYQkucBySV0xV2T0EsCwikOAC0Z4em6uPzSs38lkHrYBvosRRAk14EfPoEXqC5JdLxRm8ToZmGSQqt_RwHCaBE_3uLgQDVEB05Rdtkq-Xzuw30。 = s0-d-e1-ft was在此服务器上找不到。我们知道的就这些。
Google的代理似乎无法读取php脚本的问题。 tracking.php和GIF-example.gif文件都有775个权限,并且可以公开访问。
在Hotmail上,这样做的确很有用, Google代理商。
有人知道如何让Google代理商访问此跟踪像素?
我想出了答案:问题是与Google代理和问号?在 https://www.example.com/tracking.php?order_id=1
Google代理地址被弄乱了,因为它已经有一个问号,并导致了一个404.
我使用 https://www.example.com解决了/track.php/order_id=1
,然后在tracking.php我没有使用 $ _ GET
但 $ _SERVER ['REQUEST_URI']
并解析了 / order_id =
String。
跟踪像素显示在Gmail中,并在tracking.php脚本中进行跟踪。
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
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?
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.
这篇关于跟踪像素和Gmail代理的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!