0

I am trying to track multiple subdomains on my site. Eg: I have example.com as the main domain, abc.example.com, xyz.example.com as the subdomains. I am using google tag manager and installed the container code on the example.com page. I have set the cookie domain field as auto.

  1. I do not see the analytics for abc.example.com / xyz.example.com pages. Unable to track any of the subdomains.
  2. Do I need to install the GTM container code in each subdomain page?
  3. Google tag assistant does not show any tags present in the subdomains.
  4. even if I filter the hostname in my google analytics for abc.example.com I do not see any requests to this.

I am quite new to this and trying to understand.

Thank you.

1

You will need to install the GTM container code onto the applicable subdomains too.
The tag you have currently tracking pageviews on the main domain (example.com), provided it is using the All Pages trigger and is not restricted to only fire on the main domain, will then also track the subdomain pageviews as well.

Once the GTM container code is sorted out, create a new reporting View, and apply a filter that prepends the hostname to the requestURI in the GA reports, this will enable you to see which domain/subdomain pageviews have occured on, rather than reporting pages with the same requestURIs in aggregate (eg /).

Filter Type: Custom filter > Advanced
Field A --> Extract A: Hostname = (.*)
Field B --> Extract B: Request URI = (.*)
Output To --> Constructor: Request URI = $A1$B1
Click Save to create the filter.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.