How to track a site using domain aliases in Google Analytics, and AdSense Integration

MoreVisibility - April 30, 2009

Two things to talk about today – Domain Aliases and Google’s new announcement of officially releasing AdSense integration with your Google Analytics Account!

Part 1 of this post: Domain Aliases

“Domain Aliases” is consistently one of the top 10 searched terms on the Google Analytics Help Website. You can definitely track domain aliases properly so that Google Analytics reports cleanly, and cookie integrity holds up. The question then becomes “How do I do that?”

There are two possible ways to do this, but it depends on the type of web server – Apache or IIS – that you’re running. Following the steps outlined in this article will ensure that visitor tracking with Google Analytics is getting set under the primary domain and that all visitors are tracked consistently. Basically, you’ll want to redirect any domain aliases to the primary domain – this actually helps out with cookie integrity.

Redirecting Aliases in Apache:

Create two VirtualHost entries – the first for your primary domain (normal configuration), and the second for all aliases re-directing to the primary:

#---primary virtualhost


#---second virtualhost

RewriteEngine on
RewriteRule ^(.*)$1 [R=301]

Redirecting Aliases in IIS:

With Microsoft IIS webservers, you can create two websites in the IIS configuration – the first being the primary domain and the second will be for all other aliases redirecting to the primary.

Follow these steps to create a 301 redirect:

  1. Log in as an Administrator and open the Internet Services Manager by going to Start >> Programs >> Administrative Tools >> Internet Services Manager.
  2. Choose the server which is hosting your primary domain.
  3. In the folder, click the primary domain with your right mouse button and select Properties.
  4. Click the ‘Home Directory’ tab.
  5. In the “Redirect to:” field, enter the domain you want to redirect to. For example, if you want to redirect to, enter in this field.
  6. Under the “The Client will be sent to” section, select “A permanent redirection for this resource.” This will create a 301 redirect from your primary domain to

Read the rest of this article to find out how to use a 302 redirect instead of using a 301 redirect.

Part 2: Google AdSense + Google Analytics Integration

It is now official – you can sync your Google AdSense Account with your Google Analytics Account! When you do this, a brand new “AdSense” report section appears within your Content section of reports. There, you will find four reports:

1. Overview – This gives you a top-level breakdown of how much money the pages on your website have made for you. You’ll see brand new and exciting metrics such as AdSense Revenue, Revenue per 1,000 Visits, AdSense Click-Through Rate, Unit Impressions, Page Impressions per Visit, and other awesome analytical statistics.
2. Top AdSense Content – This allows you to see specific details about each page of your website to analyze AdSense performance. See which pages lead to AdSense clicks, and which ones don’t.
3. Top AdSense Referrers – Which sources of traffic are contributing to your AdSense bottom line? This report should answer that question for you.
4. AdSense Trending – View this histogram to see which days and what times of day visitors are clicking on the AdSense Ads on the pages of your website.

Isn’t this very exciting? But wait, there’s something else – you will now notice a new “AdSense” tab in several reports throughout Google Analytics, which allows you to analyze AdSense performance in several different report sections.

Linking your AdSense Account with your Google Analytics account is not that difficult – so ask your Administrator to set this up for you, and enjoy the new report section!

…and enjoy your properly redirected domain aliases, too :).

© 2024 MoreVisibility. All rights reserved.