No clicks reported for AdSense in Google Analytics
![]()
When I first heard that Analytics could work with AdSense, my virtual computer nipples hardened in excitement! At last, I will know what my content is worth! More than a month later, I am still helplessly awaiting this knowledge. AdSense has been failing to record clicks on ads, so I don’t know which ads are making the money. Until now, I hope.
I did a few tests with the AdSense code to see if it was working properly. Eye On Silicon isn’t the first domain on my Analytics account, and so I have to add additional code to make the link work. The code looks like this, and appears at the beginning of the <BODY> tag on any page with ads:
<script type="text/javascript"> window.google_analytics_uacct = "UA-#######-2"; </script>
I am lead to believe that the purpose of this code is to make the AdSense or Analytics code aware that this isn’t the first domain on the account, and given that I’m receiving impression reports but not click reports in Analytics, this is the only piece of code I can reasonably presume to be faulty.
I decided to write a test, and changed the code to this:
<script type="text/javascript">
window.google_analytics_uacct = "UA-#######-2";
alert("result: "+window.google_analytics_uacct);
</script>
As you can see, after setting the variable I am displaying it in the browser. This test worked fine – the result was UA-#######-2 as would be expected.
I then tried separating the code, and placing it after some Google AdSense code.
<script type="text/javascript">
window.google_analytics_uacct = "UA-#######-2";
</script>
**** GOOGLE ADSENSE CODE HERE ****
<script type="text/javascript">
alert("result: "+window.google_analytics_uacct);
</script>
The result? NULL. The code that AdSense or Analytics needs had disappeared, could this explain why my clicks aren’t being recorded? Any time after an external JavaScript is called, it seems to lose this variable. As a temporary solution (and test at this point) I’ve implemented the variable directly into the Google code so that it definitely receives the variable:
<script type="text/javascript"><!-- google_ad_client = "pub-################"; /* 300x250, created ######## */ google_ad_slot = "############"; google_ad_width = 300; google_ad_height = 250; window.google_analytics_uacct = "UA-#######-2"; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
If I start getting click reports, I’ll be contacting Google to let them know. Wish me luck!
March 16th, 2009 at 8:55 am
[...] my previous post, No clicks reported for AdSense in Google Analytics, I provided a fix for a bug in Google’s JavaScript that prevented clicks from being recorded [...]
March 16th, 2009 at 3:33 pm
I had this problem as well…it may have something to do with your tags and urls. Try this, it worked for me…
ANALYTICS
If you navigate to the ‘clicks’ tab of your AdWords reports, you will see AdWords data is there. However, it seems ‘visits’ from AdWords are not being tracked. After investigating with our specialists it seems the gclid is being dropped due to the redirects on your site and/or the existence of additional tracking parameters to your URL. For example, one of your ‘golf’ destination URL’s is http://www.canongategolf.com/index.cfm?menu=2930. We recommend you either only use autotagging, or only use manually tagging.
Using a combination of the both can be problematic as you have experienced. The following resources explain more thoroughly what might be
occuring:
http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55616
http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55477
[Reply]
March 16th, 2009 at 6:40 pm
@ Lindsey:
I believe the problem you’re referring to is specific to AdWords, the problem I’ve been having is with AdSense. Analytics appears to be very buggy with both!
[Reply]
August 2nd, 2009 at 5:29 am
The Google help site seems to claim “the account number and property index fields will be automatically populated once you link your accounts.” Does this mean entering the following in exactly as it appears below without replacing “accountnumber” and “propertyindex”?
window.google_analytics_uacct = “UA-accountnumber-propertyindex”;
Sometimes I have no idea what Google is thinking.
[Reply]
August 2nd, 2009 at 5:22 pm
Well, if that is what they mean, it’d be nice if they’d make it clearer. Are you having the same problem?
[Reply]