Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

Dodgy use of iframe?

Or am I just paranoid?

         

MatthewHSE

2:58 pm on Mar 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm looking into a tracking system for my site that would use a tiny iframe, possibly hidden via CSS. The iframe would just be used to call a separate webpage on my site that has no content of its own but would log pageviews. In other words, it's a legitimate purpose with no spamming intent at all.

But it seems that Google is starting to look at CSS and other presentation aspects of the pages it crawls, so my concern is that a tiny or hidden iframe might throw a spam flag. Is this the kind of thing that could (or would) be penalized automatically? It's almost certain to pass a manual check, so I'm not worried about that at all.

Thanks for any advice or insight,

Matthew

kaled

3:52 pm on Mar 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What advantage is there to using an <iframe> instead of an <img> for this purpose?

Kaled.

jrs_66

3:55 pm on Mar 29, 2006 (gmt 0)

10+ Year Member



I think I may agree with Kalid on this however...

I've used IFrames extensively for various purposes on highly ranked pages and I've never encountered a problem with google.

MatthewHSE

3:59 pm on Mar 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi, thanks for the quick replies. In answer to your question, kaled, the <iframe> method can use PHP to log specific data in specific ways. An image can only log the pageview itself.

LifeinAsia

5:02 pm on Mar 29, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



An image can only log the pageview itself.

Not if the image is something like "tracking.php?trackingdata=whatever"

I don't know PHP well enough, but I assume it has the same functionality as other languages to return binary data.

You pass the parameters to tracking.php the same way, just have it return back a 1x1 pixel image.

kaled

5:55 pm on Mar 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<img src="trackpages.php?pagedata=data&img=trackimg.gif">

Within trackpages.php you simply need to output the http header location: trackimg.gif i.e. you redirect to the image file.

I don't use php and I'm not great with http headers, but this method should work. Of course, there's no need to place the image url as a parameter if you're happy to use the same image in all cases.

Kaled.