开发者

Paypal auto-generated HTML code: why the 1 pixel image?

If you create a button using PayPals selling tools you are then presented with auto-generated HTML after filling in the details of the particular product you want to sell. At the bottom of this generated code is this strange piece of HTML:

<img alt="" border="0"
src="http开发者_如何学JAVAs://www.paypalobjects.com/*****-***-******-*/en_GB/i/scr/pixel.gif"
width="1" height="1">

What is this used for? It seems to serve no purpose, in fact, if i delete it, the script still seems to run fine.


I think Tom Gullen is right and the one-pixel image is there for tracking purposes. While trying to answer the same question I found the following article that is probably worth reading: http://en.wikipedia.org/wiki/Web_bug. Especially this part: "Originally, a web bug was a small (usually 1×1 pixel) transparent GIF or PNG image (or an image of the same color of the background) that was embedded in an HTML page [...] Whenever the user opens the page with a graphical browser or email reader, the image or other information is downloaded. This download requires the browser to request the image from the server storing it, allowing the server to take notice of the download."


It probably is sending data back to Paypal for tracking purposes. I would leave it in, it's highly unlikely to be malicious and might benefit you in the way of tracking stats etc.

It's also utilising an HTTPS connection so any data being sent to the Paypal server is secure.


I'd guess one of two reasons:

  1. In the olden days (2001) we used to use 1px images to make sure borders between objects appeared properly (e.g., in a table). They might do it in case the HTML is embedded on a very outdated web design.
  2. If it includes any kind of ID, they may be using it to gather statistics on how often your button is rendered (perhaps to gauge your click-through rate).
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜