homepage Welcome to WebmasterWorld Guest from 54.166.33.25
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
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

10+ Year Member



 
Msg#: 1788 posted 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

 

kaijohannkursch

10+ Year Member



 
Msg#: 1788 posted 12:27 am on Mar 3, 2004 (gmt 0)

and since you don't know how many times each ad/url was shown originally

You could always log also the impressions, it's quite easy. In fact the script developed by jonathanleger does that. The thing is that with some accounts the performance would be very poor with that huge data (my case). Also you can check your logs, stats programs, web stats... to check the impressions per file.

In any case, the information provided for this kind of scripts is very valuable. You would need only to take a look to some complete stats to realize.

Also I am concerned that the additional JS code might slow down the click-thru process or even crash some buggy browsers

That is completely false with a good code. Those scripts does not interfere at all.

dazzlindonna

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 1788 posted 2:15 am on Mar 3, 2004 (gmt 0)

Usefulness? It's very useful. Let's say you have the adsense code on a dozen different sites. Which sites are performing? Which are not? If they aren't, get rid of the adsense code and try something else that might perform better. And that's just ONE use for this kind of reporting. You'd be surprised once you see the numbers what you've been missing all this time.

trillianjedi

WebmasterWorld Senior Member trillianjedi us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 1788 posted 1:16 pm on Mar 3, 2004 (gmt 0)

That's excellent Dan - I might just take your code and play around with it.

Will send you over any revisions I make if they prove useful.

TJ

trillianjedi

WebmasterWorld Senior Member trillianjedi us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 1788 posted 1:20 pm on Mar 3, 2004 (gmt 0)

BTW Dan, it's probably worth you posting the php up here - I'm sure you'll get a lot of input.

Posting URL's is against the TOS guys - these links are likely to get deleted.

Can we not just stick to code?

TJ

crxchaos

10+ Year Member



 
Msg#: 1788 posted 2:04 pm on Mar 3, 2004 (gmt 0)

It's a shame to see people trying to profit off of what developed as an open source script but that's my own grudge to bear I suppose.

What everybody seems to be forgetting here is that none of the scripts we've tested or developed are tracking Mozilla or Opera clicks.

None.

Noel

10+ Year Member



 
Msg#: 1788 posted 2:21 pm on Mar 3, 2004 (gmt 0)

monitorman,

I'm getting an error with your "Adsense Script - Clicks"
The error is:

Script: adsense.vbs
Line: 157
Char: 1
Error: Wrong number of arguments or invalid property assignment: 'year'
Code: 800A01C2
Source: Microsoft VBScript runtime error.

Noel

trillianjedi

WebmasterWorld Senior Member trillianjedi us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 1788 posted 2:39 pm on Mar 3, 2004 (gmt 0)

crxchaos : this is a community of people who develop and market websites and web products. It goes with the terriotory ;-)

In any event, let's just get the open-source versions nicely honed. You can't compete with free.

TJ

jonathanleger

10+ Year Member



 
Msg#: 1788 posted 3:47 pm on Mar 3, 2004 (gmt 0)

Here's a version of the code that tracks page views and ad format info (it may look longish, but it's only about 1,600 bytes).:

function aslog(e) {
window.focus();
if (window.status.indexOf('go to') == 0)
{
var bug = new Image();
bug.src = 'YOURCLICKTRACKINGSCRIPT?ref=' + escape(document.location.href) +
'&url=' + escape(window.status) +
'&w=' + google_ad_width +
'&h=' + google_ad_height +
'&f=' + getVariable('format') +
'&cb=' + getVariable('color_border') +
'&cbg=' + getVariable('color_bg') +
'&cl=' + getVariable('color_link') +
'&cu=' + getVariable('color_url') +
'&ct=' + getVariable('color_text');
}
}

var iframeObj;
var elements;
elements = document.getElementsByTagName("iframe");
for (var i = 0; i < elements.length; i++) {
if(elements[i].src.indexOf('googlesyndication.com') > -1)
{
if (document.layers)
{
elements[i].captureEvents(Events.ONFOCUS);
}
elements[i].onfocus = aslog;
iframeObj = elements[i];
}
}

function getVariable(name) {
var dc = iframeObj.src;
var prefix = name + "=";
var begin = dc.indexOf("&" + prefix);
if (begin == -1) {
begin = dc.indexOf("?" + prefix);
if (begin == -1) return null;
} else
begin += 1;
var end = iframeObj.src.indexOf("&", begin);
if (end == -1)
end = dc.length;
return unescape(dc.substring(begin + prefix.length, end));
}

var bug = new Image();
bug.src = 'YOURPAGEVIEWTRACKINGSCRIPT?url=' + escape(document.location.href) + '&pv=1' +
'&w=' + google_ad_width +
'&h=' + google_ad_height +
'&f=' + getVariable('format') +
'&cb=' + getVariable('color_border') +
'&cbg=' + getVariable('color_bg') +
'&cl=' + getVariable('color_link') +
'&cu=' + getVariable('color_url') +
'&ct=' + getVariable('color_text');


kaijohannkursch

10+ Year Member



 
Msg#: 1788 posted 4:04 pm on Mar 3, 2004 (gmt 0)

if (window.status.indexOf('go to') == 0)

Still ignoring Spanish ads ("ir a"), French ads ("Afficher la page"), German ads ("gehe zu")...

All these things should not depend on the javascript, but on the server side script, cause then you could add more languages when added to AdSense.

A simple if (window.status) will tell you if an ad (and not the "ads by google" link) has been clicked.

jonathanleger

10+ Year Member



 
Msg#: 1788 posted 4:14 pm on Mar 3, 2004 (gmt 0)

Oops. I thought I had removed that. :)

Jon

linear

10+ Year Member



 
Msg#: 1788 posted 4:58 pm on Mar 3, 2004 (gmt 0)

Is
document.getElementById("google_ads_frame")working for anyone? I can't see that the iframe has that ID, but it does have that name.

Should that be document.getElementByName("google_ads_frame")?

jonathanleger

10+ Year Member



 
Msg#: 1788 posted 5:00 pm on Mar 3, 2004 (gmt 0)

Yes, use document.getElementByName("google_ads_frame").

figment88

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 1788 posted 5:12 pm on Mar 3, 2004 (gmt 0)

That might be part of the problem with cross-browser compliance.

In my experience, document.getElementById is pretty solid, but document.getElementByName is not as reliable.

jonathanleger

10+ Year Member



 
Msg#: 1788 posted 5:18 pm on Mar 3, 2004 (gmt 0)

I don't think it's the getElementByName() that is the problem. I'm not using that at all and Mozilla/Netscape still doesn't work. The problem is that onFocus is not supported for the IFRAME in the standards, so it never gets called. My testing has bared this out as true--the log() function never gets called (in Netscape 7). Here's a link for the onFocus support in browsers:

[blooberry.com...]

We need an alternative to onfocus for NS/Mozilla! I'm still working on it...

linear

10+ Year Member



 
Msg#: 1788 posted 5:22 pm on Mar 3, 2004 (gmt 0)

Well,
getElementsByName("google_ads_frame") (note the s after element) returns a reference, but getElementById("google_ads_frame") returns null. I can't see that the iframe has that id.
jonathanleger

10+ Year Member



 
Msg#: 1788 posted 5:44 pm on Mar 3, 2004 (gmt 0)

Correction to my previous statement: Mozilla and Netscape DO have onfocus on the iframe, but it's only triggered if you click on the very outer edge of the frame, not on any content inside of it.

monitorman

10+ Year Member



 
Msg#: 1788 posted 8:30 pm on Mar 3, 2004 (gmt 0)

From Noel: monitorman,
I'm getting an error with your "Adsense Script - Clicks"
The error is:

I apologize for the error. I made a change to that page just before the post which used the older zip file. The correct one is now posted on my site.

This SCRIPT tracks your financial status every x minutes and records that information to the database. You can choose to receive email notifications of updates, etc.

If you can think of improvements, just let me know.

kaijohannkursch

10+ Year Member



 
Msg#: 1788 posted 8:35 pm on Mar 3, 2004 (gmt 0)

getElementById("google_ads_frame") works perfectly. The iframe code with the "google_ads_frame" id is returned by the AdSense javascript. The thing is Netscape and other browsers are unable to access events on external iframes (I think there is no solution for this)

Noel

10+ Year Member



 
Msg#: 1788 posted 9:30 pm on Mar 3, 2004 (gmt 0)

monitorman, I'm still getting the same error with your new version!

Noel

triumph

10+ Year Member



 
Msg#: 1788 posted 1:21 am on Mar 4, 2004 (gmt 0)
Dan, I've got a newbie question, so I apologize in advance...

I'm doing all of the setup in cpanel. I created the database.. etc..

You say run the tracker.sql to create the proper tables? I'm doing this:

http://mysite.com/tracker/tracker.sql

However, it doesn't look like it's working, because when I try to ad a site in setup, it doesn't show up in the drop down box below? (not writing to DB)

Thanks.

Dan Grossman

10+ Year Member



 
Msg#: 1788 posted 1:32 am on Mar 4, 2004 (gmt 0)

Go into phpMyAdmin through cPanel and paste the contents of the .sql into the SQL box or in the SQL tab click "upload file" and select it.

triumph

10+ Year Member



 
Msg#: 1788 posted 1:39 am on Mar 4, 2004 (gmt 0)

Yeah, I don't myphpadmin in enabled from host. I'm trying to install it myself.. Maybe I should just shoot them an email.

Thanks for your help Dan.

vrtlw

10+ Year Member



 
Msg#: 1788 posted 3:47 am on Mar 4, 2004 (gmt 0)

rbacal,

Do you have Norton Internet Security installed, if so disable it and look at his profile again.

NIS disables anything that resembles the word ads.

HTH

vrtlw

10+ Year Member



 
Msg#: 1788 posted 3:48 am on Mar 4, 2004 (gmt 0)

Dan,

Any chance of incorporating an offset of hours so that we can synchronize our daily reports with those on the Adsense reports page?

richmondsteve

10+ Year Member



 
Msg#: 1788 posted 12:39 pm on Mar 4, 2004 (gmt 0)

1stTrade wrote:
monitoring now with <snip> script, and im really procured of many visitors clicking an ad 2 or 3 times! I know, google filters this out

Clicking the same ad 2 or 3 times? Or clicking 2 or 3 different ads? The former is likely filtered out, though I don't think anything definitive has been shared about that and I suspect the latter is pretty common and I suspect those clicks are credited.

[edited by: Jenstar at 4:21 pm (utc) on Mar. 6, 2004]
[edit reason] No specifics to tools, please [/edit]

vrtlw

10+ Year Member



 
Msg#: 1788 posted 1:00 pm on Mar 4, 2004 (gmt 0)

Clicking the same ad 2 or 3 times? Or clicking 2 or 3 different ads? The former is likely filtered out, though I don't think anything definitive has been shared about that and I suspect the latter is pretty common and I suspect those clicks are credited.

I would tend to agree and was tempted to post a similar reply 2 hours ago, but the fact of the matter remains someone may be interested in your topic and not find the first site on their first click to be of interest, therefore multiple clicks from the same client are to be expected. If you are seeing multiple clicks on the same advert for the same client then it would be worth keeping an eye on the situation! BTW if someone is abusing this it is easy enough to block them at the border or server level!

billegal

10+ Year Member



 
Msg#: 1788 posted 1:05 pm on Mar 4, 2004 (gmt 0)

Now that we have a script, is it fair to talk about how web site stats compare to google's?

I'm particularly concerned about understanding why ad views may be filtered. I'm seeing lots of visitors, each IP visiting a narrow topic, clicking 3-4 ads. I can't say I've detected any filtering since this is the first day.

I suppose I'll wait a day or two before drawing any conclusions for myself.

dwhite

10+ Year Member



 
Msg#: 1788 posted 1:18 pm on Mar 4, 2004 (gmt 0)

Big thanks to you lot for developing this script. Just one thing - I'm wondering if it will work with perl programs such as the AXS logging script (which is usually meant for recording site hits)...

I'm hoping of using something like this:
bug.src = '/cgi-bin/axs/ax.pl?ref=' + document.location + '&url=' + window.status.substring(6);

dazzlindonna

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 1788 posted 2:02 pm on Mar 4, 2004 (gmt 0)

one possible reason for a user clicking the same ad twice:

there have been times i've clicked an ad (not on my own site) only to realize that my popup blocker prevented it from opening up properly. so, i'd have to toggle the thing off and click again. anyway, just thought i'd let you know of at least one legitimate reason someone might click the same ad twice.

billegal

10+ Year Member



 
Msg#: 1788 posted 3:27 pm on Mar 4, 2004 (gmt 0)

Actually, I'm seeing the visitors click on 3-4 different ads. I haven't seen same ad clicked twice yet by the same visitor. I'd hope to get credit for the first situation but not the repeated click in the first situation.

floridasun

10+ Year Member



 
Msg#: 1788 posted 4:35 pm on Mar 4, 2004 (gmt 0)

Today I have seen an example of the same IP address clicking on the same ad from the same page 37 times in a period of less than a minute. I've asked Google AdSense how they would interpret a pattern like that. What do you think?

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.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved