

Ask YC: How can I track adsense clicks? - rksprst

I want to track the ad clicks I get and store some information (namely the url of the page the ad was clicked on, as well as some other info) in a database.<p>Is there any way to do this (assuming I'm using AdSense or ad code which is generated in an iframe?
======
lanej0
Google analytics (<http://analytics.google.com>)

~~~
rksprst
Can you be a little more specific on how I would accomplish this using google
analytics? The main thing I want is to run a method on adclick that stores
some values in the database (used to track clicks, for the purposes of the app
it needs to be done this way). Google analytics doesn't help accomplish that.

------
auston
ive never done it, so this is purely hypothetical... but assuming you know js:

 _you can drill down into the google adsense iframes and modify each onclick
event to have googles onclick event plus yours.

which would also require that you somehow inject your tracking function in
there as well. which hypothetically add an img tag that has a url you control.

then at that url you control you could set up some file that uses GET to grab
the url params you pass to it and saves them in a database... _

you can do that if you're interesting baking your own solution which is
probably against the TOS.

or you could just google it..and find these:

<http://www.seobook.com/archives/001370.shtml>

[http://www.shawnhogan.com/2005/11/track-adsense-clicks-
with-...](http://www.shawnhogan.com/2005/11/track-adsense-clicks-with-google-
analytics.html)

~~~
rksprst
I've looked at all those things, but I'm looking for something that's cross-
browser and that works with the newest version of adsense and google
analytics. I haven't found something that does, which is why I asked here.

