In our user forums, we often get asked about ways to handle subdomain tracking in Google Analytics. Subdomain tracking is needed whenever you want to track multiple domains like this:


in the same Google Analytics profile.

Subdomain Tracking Video


  1. Install GA code. Default UA code, all subdomains.
  2. Create views, filters and exclusions.
  3. Test
  4. Run a celebration lap!


When setting up the ‘Show subdomain filter’, here’s what you need:

Filter Type: Custom, Advanced

Field A -> Extract A

HOSTNAME  —->  (.*)

Field B -> Extract B:

REQUEST URI  —-> (.*)

Output To -> Constructor

REQUEST URI  —->  $A1$B1

Click SAVE.

Lastly, test using Google Analytics Real Time reports which browsing the site in another window to see the hostname populate.