How to Track Subdomains in Google Analytics Amsive Digital Published: October 17, 2012 2 min read Categories: Strategy Managing your master domain and your subdomain can be extremely helpful, especially if you have a blog and are focusing SEO efforts on multiple site channels. Moreover, It is necessary to make appropriate modifications in order to share visitor data across both of your domains. Google Analytics Subdomain Tracking Steps – Quick Steps Create another profile & use the same code. Add a Custom filter in the advanced settings. In Field A, type “Hostname” (word for word)- set value to (.*), In Field B, type “Request URI” (word for word) – set value to (.*), Set Output Output To –> Constructor & Provide value to be “$A1$B1” Step 1 – Create a Google Analytics Profile Google first recommends that you create a master profile for your primary domain. If you set a default profile, modifications still need to be made. The profile should have no filters added. This is extremely important, because you can always have historical data for the site you’re creating the filter for. Step 2 – Create another profile and reuse your tracking code Creating a new profile for the filter acts as a nice cushion in case there are errors you might encounter. Before you install the code your Google Analytics Code, make sure you’re within the settings. Select the option in admin>tracking code>one domain with multiple subdomains and simply copy and paste that code into the <head> section of your site. This code should be present on all pages you wish to track. Helpful Note – If you have a blog in WordPress, they have an useful plugin called, “Google Integration Toolkit”. Drop the analytics into the blog plug-in and viola! Data on every single page. *IMPORTANT* The Google Analytics code should be present on ALL pages you wish to track Step 3 – Modify your cross-domain profile with a filter to show the full domain in your content reports Once you have domain linking established, you will only see the request URI in the content reports,not the top-level or sub-domain for a given page. So for example, visits to the following pages: — https://www.example.com/index.php and another page on — https://sub.example.com/more.php The reports will show: — index.php — more.php You will not be able to differentiate which page is from which domain. To show the domain in the page reports, a filter is necessary to include all components of the page URL, as follows: In the Profile Settings page, click the Add Filter link. Choose Add New Filter and provide the filter a name. Choose Custom Filter and select Advanced on the Filter type settings. Under Advanced settings: FieldA should be set to Hostname FieldB should be set to Request URI Set the values for both Field A and Field B to (.*), which is an expression that captures all characters. Set the Output To –> Constructor option to Request URI and provide $A1$B1 as the value for that choice. Google Analytics is currently designed to track visitor and content data from a single domain.That being said, if you manage at least one (or even multiple) subdomains, that this modification to the tracking code occurs. Look forward to you losing all the unorganized data and put your insights back into shape!