Tuesday, May 7, 2013

Setting up Google Analytics so it gets AdSense data from more than one blog or website

This article is about setting up Google Analytics on your blog in a way that includes data for AdSense clicks and behaviour.


Google Analytics and Blogger.

fixing missing adsense data in google analytics when you have more than one blog or website
Analytics is Google's tool for measuring website performance:   how many visitors, how long do they stay for, what pages do they look at - and if you use AdSense, where are your earnings coming from. It's a major step up from Blogger's Statistics displays, and has far more details eg where the visitors came from, what browser they are using.

When people first started using Analytics with Blogger, they followed the standard Analytics instructions to edit their template and add the tracking code to it.

However if they switched to use a different template, the tracking code was lost unless they remembered to re-install it - and many people didn't remember.

So some Google engineers started telling people to put the code into an HTML/Javascript widget instead, because widgets are kept through template changes.

This worked well, until mobile templates were introduced. By default, mobile templates don't show HTML-Javascript gadgets. And while this can be changed, it involves editing your template (so brings back the "what if the template is changed" issue) - and it relies on the mobile-visitors using devices that run  Javascript.

So Blogger added a field to the Settings tab where you can enter the Google Analytics profile ID for the blog:   GreenLava over at BloggerSentral wrote an excellent post about using this, including how to
check if your existing template has the code needed to make use of this new field.

But recently I've noticed that while setting up Analytics this way collected data about visitor numbers, it doesn't always get data about AdSense (eg how many ad-impressions, what page do "clicks" come from, what were the keywords, what browser were getting the AdSense clicksetc). In fact, this data has been missing for all but one of my blogs recently.    So I did some investigation and found that this is deliberate - but that you can fix it.


Getting AdSense data from Analytics

If you only have one blog, and you have linked your AdSense and Analytics profiles, and  put AdSense ad units in your blog by getting the ad-code from AdSense and adding it as code, then you should be seeing AdSense data in your Analytics account.

To check, log in to Analytics and check the Reporting > Standard reports > Content panel:   when you expand it there should be a line for AdSense, and when you click that line some data should appear in the middle report panel (assuming your blog has some non-ad-blocked visitors).

But if you have more than one blog or website, then AdSense data is only put into Analytics for the one that is identified as "primary" in your Analytics profile. (For me, this is was the first blog that I added AdSense to.)

To get AdSense data in Analytics for more than one site, you need to get the tracking code-snippet for non-primary website from Analytics and install it in your blog.  See below for exact instructions for this.

I've found that AdSense ad units that were added from Blogger's Add-a-gadget wizard don't report data through Analytics even if the tracking code is installed - and this support article from Google confirms that this is expected behaviour.   I haven't been able to find any way to work around this, as yet.



How to get the AdSense tracking code for non-primary websites and blogs


Log in to Analytics with the Google account that owns your AdSense profile, and in which you have linked AdSense and Analytics.


Click on the Admin tab in the top right hand corner of any page.


In the Accounts section, click on AdSense Linking.


In the Secondary Analytics Properties list, find the name of the site you want the tracking code for (if you have more than one account).  


Click the Code Snippet link to the right of the chosen profile name.


Copy the code that is shown, and install it to your blog.   As menioned above, there are two choices for doing this:
  • Edit your template and add it to the header (ie somewhere between <head> and </head>) -  but remember that it will be lost if you change templates again in future.





Repeat this for any other blogs, except your primary one, which you want Analytics to track AdSense data for.




Related Articles:

Adding a HTML-Javascript gadget to your blog

How to edit your Blogger template

Showing gadgets on mobile templates

AdSense and AdWords - what's the difference

Setting up AdSense for your blog

Share this Article

URL:

HTML link code:

BB (forum) link code:

Subscribe to Blogger-hints-and-tips

FeedBurner will send a confirmation message. Click the verify link in it to start your subscription.

Follow Me on Pinterest Subscribe to Blogger-HAT on Google + RSS subscription icon Follow BloggerHAT on Twitter

1 comment:

  1. Just to be clear...I code the snippet in the header of the 2nd blog not the primary blog, right?

    ReplyDelete