Welcome to WebmasterWorld Guest from 54.144.68.27

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Views tracking with a fake image

What is better: png or gif?

     

GreenLeaf

6:38 pm on Mar 18, 2005 (gmt 0)

10+ Year Member



In different code sources i saw 2 methods of tracking views (for example, newsletter open rate) with 'fake' image:

header("Content-Type: image/png");
print base64_decode('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAABGdBTUEAALGPC/xhBQAAAAZQTFRF////
AAAAVcLTfgAAAAF0Uk5TAEDm2GYAAAABYktHRACIBR1IAAAACXBIWXMAAAsSAAALEgHS3X78AAAAB3RJTUUH0gQCEx05cq
KA8gAAAApJREFUeJxjYAAAAAIAAUivpHEAAAAASUVORK5CYII=');
(without word wrap, of course)

and


Header("Content-Type: image/gif");
Header("Content-Length: 43");
echo chr(0x47).chr(0x49).chr(0x46).chr(0x38).chr(0x39).chr(0x61).chr(0x01).chr(0x00).
chr(0x01).chr(0x00).chr(0x80).chr(0x00).chr(0x00).chr(0x04).chr(0x02).chr(0x04).
chr(0x00).chr(0x00).chr(0x00).chr(0x21).chr(0xF9).chr(0x04).chr(0x01).chr(0x00).
chr(0x00).chr(0x00).chr(0x00).chr(0x2C).chr(0x00).chr(0x00).chr(0x00).chr(0x00).
chr(0x01).chr(0x00).chr(0x01).chr(0x00).chr(0x00).chr(0x02).chr(0x02).chr(0x44).
chr(0x01).chr(0x00).chr(0x3B);

Which is better?
Thanks

jatar_k

10:13 pm on Mar 18, 2005 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I don't see why it would matter

GreenLeaf

12:06 am on Mar 19, 2005 (gmt 0)

10+ Year Member



Maybe there is some difference in gif/png support in various applications/browsers?

jatar_k

12:14 am on Mar 19, 2005 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



aahhh, missed that, sry, I would say gif

GreenLeaf

8:33 pm on Mar 19, 2005 (gmt 0)

10+ Year Member



Thanks!

By the way, is that code in examples valid?

jatar_k

1:58 am on Mar 20, 2005 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I imagine it works for what they are doing but you may need to customize it for what you are particularly doing.

GreenLeaf

12:17 pm on Mar 21, 2005 (gmt 0)

10+ Year Member



Customize it? I thought that it was a code for 1x1 image's output. How it can be customized?
Thanks.

jatar_k

5:50 pm on Mar 21, 2005 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



just try it, see if it works. :)

I haven't tried it

GreenLeaf

1:04 am on Mar 22, 2005 (gmt 0)

10+ Year Member



Thanks a lot for your answers!
 

Featured Threads

Hot Threads This Week

Hot Threads This Month