Hacker News new | past | comments | ask | show | jobs | submit login
Ask YC: How can I track adsense clicks?
4 points by rksprst on June 2, 2008 | hide | past | favorite | 4 comments
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.

Is there any way to do this (assuming I'm using AdSense or ad code which is generated in an iframe?




Google analytics (http://analytics.google.com)


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.


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-...


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: