How to Integrate another Website to Google Analytics Tracking and Adsense

This was supposed to be obvious, but I couldnt find easily how to integrate Google Adsense and Analytics to track your Adsense Ad performance on google analytics. Make sure you display ads on your page and the analytics tracking code. Make sure you have linked the adsense and analytics together before doing this. The following is to add one more site to track adsense.

And then Getting straight to the answer, put the following script on the head.

<script type="text/javascript">window.google_analytics_uacct = "UA-XXXXXX-X";</script>

Replace XXXXXX-X with your analytics tracking ID which you can obtain from the analytics tracking script or from the analytics setting page as shown in the image below.

Then goto the analytics settings page, and click the link highlighted below Edit Adsense linking settings

Google Analytics Adsense Linking

Adsense on analytics screenshot

Google Analytics Tracking ID

On Drupal

You can set the header in code by drupal_set_html_head or add in the page.tpl.php, Alternatively you can install the Google Analytics module from drupal, and goto admin/settings/googleanalytics choose advanced settings and check the Track Adsense Ads option. Google Analytics drupal module settings

:) 30 Nov, 2009
Comments (0)
You may also like
On Facebook
Email Newsletter