homepage Welcome to WebmasterWorld Guest from 54.243.13.30
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Home / Forums Index / Google / Google AdSense
Forum Library, Charter, Moderators: incrediBILL & jatar k & martinibuster

Google AdSense Forum

This 205 message thread spans 7 pages: 205 ( [1] 2 3 4 5 6 7 > >     
developing AdSense tracking script
what do you think of tracking AdSense independently?
monolitik




msg:1435608
 9:44 am on Feb 25, 2004 (gmt 0)

Hello,

I have seen posts that wish detailed AdSense reports such as site level or page level stats.

Currently, we are working on a script to track AdSense impressions and clicks. The script lets you track the stats of sites, pages, referrers, color combinations, ad formats, visitor countries, paid or alternate ads displayed etc.

To remove questions, it conforms to Google TOC completely. No change to AdSense code, no interference.

I want to know your opinions on tracking AdSense independently. Do you personally want to use such a script? What features would you expect?

Thanks

 

tombola




msg:1435609
 10:44 am on Feb 25, 2004 (gmt 0)

Welcome to Webmasterworld, monolitik!

we are working on a script to track AdSense impressions and clicks

So you can write a script to track impressions and clicks that are logged on a server (googlesyndication.com) where you have no access to?... Very impressing.

... and you do that without witchcraft or any magical powers?

monolitik




msg:1435610
 12:08 pm on Feb 25, 2004 (gmt 0)

Welcome to Webmasterworld, monolitik!

Thank you.
So you can write a script to track impressions and clicks that are logged on a server (googlesyndication.com) where you have no access to?... Very impressing.

... and you do that without witchcraft or any magical powers?


No, even we can not write that magical thing :)

What we are doing is to track the impressions and clicks by placing a javascript code to the page having an adsense code. The tracking code reports the activity to a script installed on your server. Hope it makes sense now.

trillianjedi




msg:1435611
 12:35 pm on Feb 25, 2004 (gmt 0)

What we are doing is to track the impressions and clicks by placing a javascript code to the page having an adsense code. The tracking code reports the activity to a script installed on your server. Hope it makes sense now.

I'm no javascript expert, so forgive me if this sounds like a stupid question, but would that not involve trapping the AdSense click and then regenerating it?

TJ

monolitik




msg:1435612
 1:07 pm on Feb 25, 2004 (gmt 0)

I'm no javascript expert, so forgive me if this sounds like a stupid question, but would that not involve trapping the AdSense click and then regenerating it?

No. Actually you can not trap or capture clicks to adsense because it is displayed in an IFRAME and the frame content is from a different domain (Google) than yours. Browsers prohibit this. That is why Google is using IFRAME to display the ads.

We developed an heuristic algorithm to guess the click indirectly, which involves analysis of some other events the visitor generated before leaving the document. Surely you have rigth to monitor the events on your page without interfering with Google code.

Yidaki




msg:1435613
 1:30 pm on Feb 25, 2004 (gmt 0)

>No. Actually you can not trap or capture clicks to
>adsense because it is displayed in an IFRAME

Realy? Well, after i read this thread, i wrote a javascript that actually TRACKS CLICKS on adsense ads (no altering or regenerating of clicks. Just a second function that gets invoked for the same click event). Took me 15 minutes. Don't know if it complies with the AdSense TOS though. But it's just a javascript one liner. I think, i'm going to give it a test run for a few days.

>heuristic algorithm to guess the click indirectly, which involves analysis of some other events

C'mon - honestly, that sounds cool but it's pretty useless.

[edited by: Yidaki at 1:32 pm (utc) on Feb. 25, 2004]

richmondsteve




msg:1435614
 1:31 pm on Feb 25, 2004 (gmt 0)

monolitik wrote:
We developed an heuristic algorithm to guess the click indirectly, which involves analysis of some other events the visitor generated before leaving the document.

Tracking impressions is straigtforward. I am curious how you attempt to guess 1. whether an ad is clicked, 2. which ad position is clicked and 3. what the destination URL of that ad is and does so without violating the AdSense TOS. With a pretty major assumption about user behavior I can think of a way to use the onMouseover event to estimate #1 and #2, but not #3.

monolitik




msg:1435615
 1:59 pm on Feb 25, 2004 (gmt 0)

Yidaki:
Realy? Well, after i read this thread, i wrote a javascript that actually TRACKS CLICKS on adsense ads (no altering or regenerating of clicks. Just a second function that gets invoked for the same click event). Took me 15 minutes. Don't know if it complies with the AdSense TOS though. But it's just a javascript one liner. I think, i'm going to give it a test run for a few days.

[msdn.microsoft.com...]
[msdn.microsoft.com...]
Good luck.

richmondsteve:
Tracking impressions is straigtforward. I am curious how you attempt to guess 1. whether an ad is clicked, 2. which ad position is clicked and 3. what the destination URL of that ad is and does so without violating the AdSense TOS. With a pretty major assumption about user behavior I can think of a way to use the onMouseover event to estimate #1 and #2, but not #3

We do not guess #2 and #3. Only #1.

Please. I did not opened this topic to discuss technical issues. I just want to learn what AdSense publishers think tracking AdSense by their own and thus having much detail Google does not provide.

Yidaki




msg:1435616
 2:00 pm on Feb 25, 2004 (gmt 0)

>Good luck.

It's running, believe me. Don't need a ms workshop.

tombola




msg:1435617
 2:04 pm on Feb 25, 2004 (gmt 0)

figment88 posted his solution in this thread a few weeks ago:

[webmasterworld.com...]

Yidaki




msg:1435618
 2:12 pm on Feb 25, 2004 (gmt 0)

Ok, here's mine:

<script language="JavaScript">
function trackAS() {
if (document.frames[0].event.type == "blur") {
alert(document.frames[0].event.srcElement.id + " : " + document.frames[0].event.srcElement);
}
}
</script>
<body onunload="trackAS()">

What do you all think about TOS compliance?

trillianjedi




msg:1435619
 2:17 pm on Feb 25, 2004 (gmt 0)

I can't see anything in the google TOS which prohibits click-tracking.

But gut instinct tells me google wouldn't like it

TJ

Yidaki




msg:1435620
 2:57 pm on Feb 25, 2004 (gmt 0)

>But gut instinct tells me google wouldn't like it

I tend to agree.

However, i see it as a great way for publishers to controll / observe fraud themself. Imagine this nifty little script combined with a blocking mechanism that either blocks clients completely or just suppresses AdSense display for clients that show suspicous click activity ... pretty easy to set up and very efficient.

May be AdSenseAdvisor would like to comment?

trillianjedi




msg:1435621
 3:11 pm on Feb 25, 2004 (gmt 0)

...... or just suppresses AdSense display for clients that show suspicous click activity

I like the idea in principle, but isn't a bit like locking the barn door after the horse has bolted?

To detect "suspicious" clicking, you need to let it happen. By then there is the risk that Google have already clocked it and the warning email (or worse) is under way.

I suppose if you could detect the activity early enough, you could block it from continuing though. I guess 4 suspicious clicks is better than 10.....

I think we need the word on TOS compliance/Googles view from ASA here.

TJ

Yidaki




msg:1435622
 3:24 pm on Feb 25, 2004 (gmt 0)

trillianjedi, i already have a pretty sophisticated algorithm that protects some of my sites from content suckers and even notifies me in special cases. I watch several parameters that can be fine tuned. So this combined with the adsense tracking skript would be much better than waiting for THE email of google.

>I think we need the word on TOS compliance/Googles view from ASA here.

Absolutely!

[edited by: Yidaki at 3:24 pm (utc) on Feb. 25, 2004]

figment88




msg:1435623
 3:24 pm on Feb 25, 2004 (gmt 0)

Clearly, with the script I wrote and what other people are proposing it is possible and fairly simple to track clicks down to a page level.

Google has stated that they will offer domain level tracking.

While page level data is obviously preferable to domain level, I am willing to wait on Google. I find their foot dragging awful and many of their rules capricious, but the person who pays the piper gets to call the tune.

trillianjedi




msg:1435624
 3:28 pm on Feb 25, 2004 (gmt 0)

Yidaki - ok, well that sounds great.

I'd love to have this kind of page level tracking. It helps me, I then help google and the AdWords advertisers make money.

None of us is going to try something like this at risk of getting kicked from the program, so it's the authority answer that we await......

TJ

Macro




msg:1435625
 3:32 pm on Feb 25, 2004 (gmt 0)

This all sounds like very clever stuff. Since I can't tell a js from a hole in the ground I won't comment on what the scripts can and can't do.

I want to know your opinions on tracking AdSense independently. Do you personally want to use such a script? What features would you expect?

Of course I'd like to track Adsense independently. Of course there is the issue that Google won't like it. Correction - they'll go ballistic back at the plex and we'll get a new, improved and better cleaning TOS within a few days (not another one!).

Out of curiousity I'd like to know who's getting my traffic and be able to track who I'm sending how many visitors to. It can't be in Google's interest for me to know that of course as I may be generating enough traffic for advertiser X to approach them directly and try to cut Google out of the loop.

[edited by: Macro at 3:38 pm (utc) on Feb. 25, 2004]

freeflight2




msg:1435626
 3:37 pm on Feb 25, 2004 (gmt 0)

I think the issue might be not the 'tracking' itself but the JS code sending a request back to your own server once somebody clicked an ad (to notify you that something happened) which G might interpret as 'interfering' with the click-thru process.

trillianjedi




msg:1435627
 3:40 pm on Feb 25, 2004 (gmt 0)

which G might interpret as 'interfering' with the click-thru process.

I know what you're saying, but I cannot see that interpretation. "Interfering" I take, in the context of that clause in the TOS, as meaning "obstructing" or sending someone off somewhere else, or in an iFrame etc.

It's about tracking, and on that the TOS is silent. At the moment anyway (Macro's post refers).

TJ

AdSenseAdvisor




msg:1435628
 10:57 pm on Feb 26, 2004 (gmt 0)

May be AdSenseAdvisor would like to comment?

I'm sorry not to have responded sooner - I haven't had the time that I would like to have for posting :)

In regards to your questions: I don't know much about scripts such as these, so I can't comment on any of them in particular. But if you're not modifying the code, or trapping the clicks or changing the way ads are processed, it should be all right to implement a click-counter script like the ones suggested.

Do be careful not to change the ad code without realizing it, though.

ASA.

my2cents




msg:1435629
 3:58 am on Feb 27, 2004 (gmt 0)

Can someone explain Yidakiís script with more detail? Perhaps a sample page without pub ID. Iím having trouble understanding exactly how to utilize this script.

Thanks!

figment88




msg:1435630
 4:28 am on Feb 27, 2004 (gmt 0)

I got a couple stickies asking me about how I would log using a webbug.

In the prior code I wrote, there was a function called log that got excuted everytime a iFrame receives focus. For testing, I just had it do a JavaScript alert, but you could easily call a webbug.

A webbug is a script excuted by a HTML tag (usually img). The script can be any type including PHP, PERL, ColdFusion, VB, etc.

I predomiantely code in PHP, so here's how it would look.

In the main document there is a JavaScipt function

function log() {
bug = new Image();
aURL='/pix.php?title=' + document.title;
bug.src = aURL;
}

Now everytime the log function gets executed it will cause a webserver hit to pix.php with the page's title as a parameter.

pix.php is then a php script that logs the action to a database or writes it to a flat file:

<?
if(!empty($_GET['title'])) $title=$_GET['title']; else $title='NA';
$ip=getenv(REMOTE_ADDR);

$sql="INSERT INTO log SET title=\"$title\",ip=\"$ip\"";
$result=mysql_query($sql);
?>

Obviously, it's helpful if the Database table log has an automatic timestamp column.

Yidaki




msg:1435631
 8:33 am on Feb 27, 2004 (gmt 0)

>Can someone explain Yidakiís script with more detail

The script tracks events that happen in an iframe on the page (clicks in this case). You can expand the script to track the clicks using a web bug - like figment88 described.

BUT THIS DOESN'T WORK WITH ADSENSE

Uhm, why? Erm, i stand corrected what monolitik said. My appologize to you, monolitik - i should have known it since i had exactly the same problem with an app i wrote a few months ago ... oh well. Call me ignorant. ;)

The script runs pretty well with iframes that reside on the same server/domain where the page is located. BUT for security reasons, its NOT possible to access content or events of an iframe if the iframe content is loaded from a different domain (in this case google).

Again, sorry, monolitik and others for the confusion i brought.

The script simply won't work with AdSense - nor does figment88's script since it also uses the event handler.


However, thanks AdSenseAdvisor for your comment - now we at least know that it's allowed to track clicks - if we'd just have a script that could do this ... ;)
Macro




msg:1435632
 9:56 am on Feb 27, 2004 (gmt 0)

AdSenseAdvisor says:
it should be all right to implement a click-counter script like the ones suggested

I'm floored. I'll join Yidaki in standing corrected. I didn't for a moment think that Google wouldn't mind us tracking clicks.

:::::: still shaking my head in disbelief :::::::

trillianjedi




msg:1435633
 10:31 am on Feb 27, 2004 (gmt 0)

Many thanks for the comments and clarification ASA.

I'm not a coding pro, but I think I have it right in that the "page" lies within an iFrame on someone elses domain and you cannot therefore track what happens there.

I guess this makes sense, otherwise everyone would be intercepting clicks to banks and "buy now" links...

Does that mean some kind of AdSense tracking tool is impossible?

Oh and going back to Monolitik's original post. Can we see the code, or see your script in action?

TJ

RichD




msg:1435634
 10:58 am on Feb 27, 2004 (gmt 0)

I'm not a great javascript writer either, but it looks like one possibility may be to use the mouse position when the page is unloaded and relate this some how to the adwords Iframe. Just an idea that someone more talented might like to explore.

figment88




msg:1435635
 3:19 pm on Feb 27, 2004 (gmt 0)

I'm only a marketer, but I am pretty sure my code works. I did test it using external iFrames from FastClick.

Of course you can't track events within an external iFrame. However the iFrame container is not external. The code that invokes the iFrame resides in the local document and you can track container events (e.g. when it receives focus).

Yidaki why don't you try my script, then tell me it doesn't work. I am more than happy to be coreected.

jonathanleger




msg:1435636
 3:59 pm on Feb 27, 2004 (gmt 0)

Way to go figment88! I just installed your little script on my site and sure enough it tracks the clicks to AdSense! Only drawback... it also tracks the clicks to the 'Ads by Google' url (which is what I tested it on). But I can handle that since very few, if any, visitors will ever click on that link.

Thanks a million!

trillianjedi




msg:1435637
 4:01 pm on Feb 27, 2004 (gmt 0)

Good stuff figment88 - will have a play with your code myself later.

I rather suspect that Monalitik is doing something similar, but with a little more guesswork, possibly the position that the mouse was in when it entered the google iFrame, then taking a guess as to where the user was heading before the click?

TJ

This 205 message thread spans 7 pages: 205 ( [1] 2 3 4 5 6 7 > >
Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Google / Google AdSense
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved