Forum Moderators: martinibuster
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
And how many enemies decide to screw up your internal click tracking stats
For this reason I've now encrypted the javascript.
I have some "friends" who would love to run the "as.asp=www.some-url.com&url=www.an-other-url.com" sting on my sites! (for fun!)
After encrypting the code I made it a bit harder for them to find the needed data!
Noel
No need to verify, ASA said everything is A OK and he speaks for Google.
Actually, when ASA said that they thought it would be ok to run a click counter script, it wasn't at the same point in the discussion as it is now.
ASA said that they couldn't comment on any script in particular.
It would be interesting to see a further comment now that the script has progressed, and talk of a third party tracking server (where you would have to give pass your stat information to).
It seems to be a different animal now, than was first commented upon.
I commented earlier that I wasn't seeing the URL, and that I didn't think it was possible to display the window status bar that the browser displays on mousover - only if you set it explicitly.
Well, I just realized the answer was staring me right in the face. Google DOES explicitly set window.status, because they hide the raw link with that "go to www.domain.com" status message. My testing with the AdSense code was limited to clicking on the "Ads by Google" link, where they don't do that. Duh!
I will be adding CTR info to the script and trying to work out some of the few (and minor, but real) bugs in the tracking (such as right-clicking). It will be easy to figure out whether the onfocus was triggered by a right-click or a left-click, and trapping that accordingly. So thanks to crxchaos for that. I'll post the code here once it's done.
As far as whether it's "safe" to let a third party manage your AdSense data, I agree with whoever it was that said if you let a third party manage your traffic statistics you're "in jeopardy" according to those thoughts.
In fact, if looked at from that perspective, unless you have your own server that you maintain, all of your data is sitting on somebody else's hardware, accessible to whoever it is that is hosting your site. So I personally don't have a problem with letting somebody else manage my data if the service is reliable.
<script language=javascript>
function log()
{
if (window.status.indexOf('go to') == 0)
{
bug = new Image();
bug.src = 'as.asp?ref=' + document.location + '&url=' + window.status.substring(6);
}
}
document.body.onunload = log;
</script>
If it is possible to test whether the iframe has focus when the log() function executes it should be almost foolproof but my javascript/DOM knowledge doesn't extend that far.
On my (low traffic) site I'm already seeing approx. 100% more clicks reported from this tracking than Google's! As I deal with such low numbers each day I can also infer the CPC of each site, lost earnings from 'filtered' clicks, etc.
Although some might scoff at the actual value of having this data as a publisher, it sure is interesting :)
"God bless those AOL users"
I am now taking bets on when it is that Google comes out with its own tracking system. The closest to the date wins a link from my site to theirs as long as it is not "PRON" for a couple of months. Nope not on the homepage :)
My guess: May 24th 2004
The PHP script supports all AdSense languages (English, Spanish, French...) so all clicks are accounted. It filters out clicks on the same ad from the same IP... The thing is in the first whole day (the script time zone is the same used in AdSense) the script only accounted 4% less clicks than in my AdSense account.
The script returns advanced stats: domains, files, ads clicked, ips, ids (used for distinct random ad styles in our case). Stats by day and by hour. It allows discrimination by time period and domain/file/ad/ip.
So you can, for instance, control what ads are most clicked, when, where and by whom, what ad style is better for every domain/file...
If someone is interested, please PM me.
[edited by: kaijohannkursch at 4:03 pm (utc) on Mar. 1, 2004]
function hit(){
window.focus();
if (window.status){
img = new Image();
img.src = 'http://domain.com/tracking.php?ref=' + escape(document.location) + '&title=' + escape(document.title) + '&ad=' + escape(window.status) + '&id=****';
};
};
document.getElementById("google_ads_frame").onfocus = hit;
Advantages:
- The window.focus blur the focus from the iframe, so the script handles better erroneus/true duplicated clicks.
- The "go to" is not included in the js, so ALL ad languages are supported. The window.status decide if an ad has been clicked or not.
- The escape in the url parameters avoids querystring problems.
- The script does not use the innecesary loop to catch the iframe.
By the way, I checked my results for the first day and I detected NO clicks from Netscape users. Nor Opera nor Mozilla nor that new Mac browser whatever it's called. 100% MSIE. Without giving anything away, lets just say I would have expected to see some other browsers, statistically.
The .php stat generation and logging is pretty easy. I'm sure we'll also be doing something along those lines over this week. Code will definitely be placed here, community spirit is what this place is about.
Maybe better or worse than other peoples, but having a large pool of ideas and implementations I'm sure will result over the coming months into a seriously honed tool that we all can use to our advantage.
That's what is so great about all the code postings on here so far - you can pick and choose the best of everyone's to tailor to exactly what you're after for your own particular need.
TJ
The script returns advanced stats: domains, files, ads clicked, ips, ids (used for distinct random ad styles in our case). Stats by day and by hour. It allows discrimination by time period and domain/file/ad/ip.
The only thing we personally don't need for our sites is your "ids" thing (but seems like a straightforward enough idea - a good one though).
I'm not sure what you're doing in your script that you feel warrants non-disclosure, but I can assure you all of the .php-ers I know of here can build this, quickly and very easily. I'm not a php coder (although am a programmer) and even I could build this. Perhaps you feel you've come up with a very clever filtering algo or something.
The next week to 10 days on this thread are set to be very interesting I think.
TJ
I'm not sure if I did something wrong, but your javascript is still registering "right clicks" on the ad!
Reporting is more accurate allowing right-click.
Think most people use right-click to "open in a new window" or "copy shortcut".
I think you could also test for a nonblank window.status, so that clicks on "Ads by Google" don't show up in the report
Clicks on "Ads by Google" are not counted.
but I can assure you all of the .php-ers I know of here can build this
OK, every application made by every programmer is exactly the same to similar applications made by other programmers... Then we all programmers should earn the same salary! :P I've been developing professional applications for years and I can assure you not all applications are the same (luckily).
I'm not trying to convince all about anything, just another point of view.
[edited by: kaijohannkursch at 6:32 pm (utc) on Mar. 1, 2004]