close

Multiple Domains with Subdomain

Step 1: How many domains will you be tracking?

Step 2: Enter your domain names:

Step 3: Enter your subdomain:

Step 4: Enter your Google Analytics account number:

Step 5: Are you using the traditional (ga.js) syntax or the Asynchronous syntax?

Asynchronous Setup Traditional ga.js Setup

Step 6: Replace any existing Google Analytics tracking code with the following script just before the closing </head> tag on

Any time you link to you will need to add this onClick tag to your link. Be sure to place the full URL you're linking to in the onClick tag.

If you have a form setup on this domain that when submitted takes the visitor to one of your other domains, you should include this code in your form:

Any time you link to you will need to add this onClick tag to your link. Be sure to place the full URL you're linking to in the onClick tag.

If you have a form setup on this domain that when submitted takes the visitor to one of your other domains, you should include this code in your form:

Any time you link to you will need to add this onClick tag to your link. Be sure to place the full URL you're linking to in the onClick tag.

If you have a form setup on this domain that when submitted takes the visitor to one of your other domains, you should include this code in your form:

Any time you link to you will need to add this onClick tag to your link. Be sure to place the full URL you're linking to in the onClick tag.

If you have a form setup on this domain that when submitted takes the visitor to one of your other domains, you should include this code in your form:

Step 7: Replace any existing Google Analytics tracking code with the following script just before the closing </head> tag on

If you have a form setup on this domain that when submitted takes the visitor to one of your other domains, you should include this code in your form:

Replace any existing Google Analytics tracking code with the following script just before the closing </head> tag on

If you have a form setup on this domain that when submitted takes the visitor to one of your other domains, you should include this code in your form:

Replace any existing Google Analytics tracking code with the following script just before the closing </head> tag on

If you have a form setup on this domain that when submitted takes the visitor to one of your other domains, you should include this code in your form:

Replace any existing Google Analytics tracking code with the following script just before the closing </head> tag on

If you have a form setup on this domain that when submitted takes the visitor to one of your other domains, you should include this code in your form:

Any time you link to you will need to add this onClick tag to your link. Be sure to place the full URL you're linking to in the onClick tag.

Step 8: Replace any existing Google Analytics tracking code with the following script just before the closing </head> tag on

Now we need to set up a new profile in Google Analytics that will track all your domains together (your main domain and your subdomain(s)). This way, you will always have baseline historical data for your domains that you can refer to if you make errors when setting up filters in your new profile.

Step 9: From the Account Home page of your Google Analytics, select the account under which you want to add the profile.

Step 10: Click the gear icon on the right of the top navigation in your Google Analytics account.

Step 11: In the Profiles tab, click the “ + New Profile” button.

Step 12: Enter a Profile Name as you’d like it to appear in your account (example: Domain and Sub-Domain Traffic).

Step 13: Click “Create Profile” to add the new profile.

Step 14 (Optional): Apply the following advanced filter to this new profile to differentiate subdomains within it:

Filter Type: Custom filter > Advanced
Field A: Hostname
Extract A: (.*)
Field B: Request URI
Extract B: (.*)
Output to: Request URI
Constructor: $A1$B1

Step 6: Replace any existing Google Analytics tracking code with the following script just before the closing </body> tag on

Any time you link to you will need to add this onClick tag to your link. Be sure to place the full URL you're linking to in the onClick tag.

If you have a form setup on this domain that when submitted takes the visitor to one of your other domains, you should include this code in your form:

Any time you link to you will need to add this onClick tag to your link. Be sure to place the full URL you're linking to in the onClick tag.

If you have a form setup on this domain that when submitted takes the visitor to one of your other domains, you should include this code in your form:

Any time you link to you will need to add this onClick tag to your link. Be sure to place the full URL you're linking to in the onClick tag.

If you have a form setup on this domain that when submitted takes the visitor to one of your other domains, you should include this code in your form:

Any time you link to you will need to add this onClick tag to your link. Be sure to place the full URL you're linking to in the onClick tag.

If you have a form setup on this domain that when submitted takes the visitor to one of your other domains, you should include this code in your form:

Step 7: Replace any existing Google Analytics tracking code with the following script just before the closing </body> tag on

Replace any existing Google Analytics tracking code with the following script just before the closing </body> tag on

Replace any existing Google Analytics tracking code with the following script just before the closing </body> tag on

Replace any existing Google Analytics tracking code with the following script just before the closing </body> tag on

Any time you link to you will need to add this onClick tag to your link. Be sure to place the full URL you're linking to in the onClick tag.

If you have a form setup on this domain that when submitted takes the visitor to one of your other domains, you should include this code in your form:

Step 8: Replace any existing Google Analytics tracking code with the following script just before the closing </body> tag on

Now we need to set up a new profile in Google Analytics that will track all your domains together (your main domain and your subdomain(s)). This way, you will always have baseline historical data for your domains that you can refer to if you make errors when setting up filters in your new profile.

Step 9: From the Account Home page of your Google Analytics, select the account under which you want to add the profile.

Step 10: Click the gear icon on the right of the top navigation in your Google Analytics account.

Step 11: In the Profiles tab, click the “ + New Profile” button.

Step 12: Enter a Profile Name as you’d like it to appear in your account (example: Domain and Sub-Domain Traffic).

Step 13: Click “Create Profile” to add the new profile.

Step 14 (Optional): Apply the following advanced filter to this new profile to differentiate subdomains within it:

Filter Type: Custom filter > Advanced
Field A: Hostname
Extract A: (.*)
Field B: Request URI
Extract B: (.*)
Output to: Request URI
Constructor: $A1$B1

Get Google Analytics Configuration News

Be the first to know when Raven updates GAConfig.com.