Articles written in April, 2009

April 30 2009

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


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 :).

April 13 2009

The 6 Benefits of migrating to GA.js


It’s official – urchin.js is not “going dark” anytime soon. However, that doesn’t mean that you shouldn’t upgrade your website’s Google Analytics Tracking Code to the newer, fresher, more dynamic GA.js tracking module. Sure, you can continue to use urchin.js and your data will still be collected and appear in your reports. However, there are not one, not two, but six benefits of spending a bit of time editing your footers, includes, or hard-coding your HTML source code to include the GA.js tracking script.

Let’s review these six great benefits one by one:

1. A Faster and Smaller Source File – Even though the actual sizes of the files are almost identical at 22.1 KB, the urchin.js file is over 600 lines long and is slower, less efficient. The ga.js file is a mere 41 lines long and is a very modern object-oriented tracking model. See them for yourself (Download urchin.js | Download ga.js). Think of this like you would think of two of the same car – for example – two Toyota Corollas, one from 1995 and the other from 2009. They both weigh about the same, but one is much more modern, environmentally sound, and better on gas than the other one.

2. Automatic detection of HTTPS – This saves a boatload of programming and coding time. Simply insert ga.js across all of your website’s pages without having to worry about coding differently for those secure pages that are being uploaded to the secure server. GA.js will automatically detect the protocol – urchin.js cannot do this unless you physically edit the tracking code.

3. Increased Namespace Safety – What this means in the most basic of layman’s terms is that ga.js does a better job in protecting your individual security (in terms of data) than urchin.js can. While ga.js never collects personally-identifiable information, such as zip codes or personal email addresses, it still needs a way to uniquely identify each visitor that accesses a website, which ga.js does in a safer way.

4. More convenient for tracking Ecommerce transactions – With ga.js, you can simply add the calls to _addTrans, _addItem, and _trackTrans right after the call to _trackPageview within the tracking code. There is no need for additional scripts or onLoad events like there is with urchin.js.

5. More customizable code for AJAX-based sites – The ga.js tracking code opens the door for “Web 2.0” websites that are loaded with videos, applets, widgets, and flash movies. This is almost not possible to do with urchin.js.

6. Take advantage of tracking functionality as it is added to Google Analytics – New, jazzy features such as Event Tracking can only be used if the website is using ga.js. The web is becoming less and less static with each passing day, and the need is increasing for being able to track actions on movies and flash games that are on many websites today. With urchin.js, this is not possible. Also, as new reports and sections are added to Google Analytics, you will need to be using ga.js to be able to take advantage of them.

Is migrating to urchin.js required? No, it is not. Is it highly recommended? Yes, positively it is.

© 2017 MoreVisibility. All rights reserved