tmartin314 tmartin314 - 1 year ago 111
HTML Question

Track impressions from image src tag

I need to include an image tag that references a script:

<img src=""/>

But I'm not sure of how to make this invisible. Sort of behind the scenes to track impressions.

2 Questions:

  1. How do I properly layout the tag?

  2. What would script.php contain?

Answer Source

You could make it into a web bug - the script could return a 1x1 transparent GIF image (create a 1x1 transparent GIF and save it on your server):

header('Content-Type: image/gif');
// whatever tracking/data mining you want to do with the data, do that here.

Note that this is the technical side of things, the legal part on web tracking etc. is up to you (and your company's legal dept.)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download