Ask YC: How can I track adsense clicks?
2 comments
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-...
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.
Is there any way to do this (assuming I'm using AdSense or ad code which is generated in an iframe?