GA4 Subdomain Tracking – How to view subdomains traffic

Make sure GA4 Subdomain Tracking is enabled for you.

By default, GA4 automatically tracks traffic from all subdomains, provided they share the same root domain; they all use the same GA4 property and the same web data stream, which means they must use the same GA4 measurement ID.

For example: 

Root Domain: optimizesmart.com

Subdomains:

learn.optimizesmart.com

training.optimizesmart.com

Suppose you install the GA4 tracking code on optimizesmart.com and ensure all subdomains inherit that code (or have their own copy with the same Measurement ID). In that case, GA4 will seamlessly track user activity across these subdomains.

Consider the following scenario:

  1. A user visits the main website, optimizesmart.com, and browses a couple of articles. (GA4 tracks this visit)
  2. The user then clicks on a link to learn more about the Digital Analytics Implementation Program, which takes them to training.optimizesmart.com. (Since it’s a subdomain, GA4 recognises it as part of the same website and continues the session.)
  3. The user reads detailed information on the ‘training’ subdomain and decides to enrol into the program. (This activity is also recorded within the same session.)

You get a complete picture of how users interact across all your subdomains, which helps you understand their overall behaviour and interests.

In essence, GA4 treats all subdomains sharing the same root domain (optimizesmart.com in this case) as one website for tracking purposes as long as they use the same Measurement ID.

Here is how you can view traffic to various subdomains in GA4.

By default, the data in your GA4 reports include only the request URI and not the domain name.

This makes it impossible to view subdomain traffic.

The request URI is that part of the URL that comes after the domain name.

For example, if your URL is: https://www.optimizesmart.com/contact/

Then request URI would be: /contact/

The hostname would be: https://www.optimizesmart.com

Unlike in Universal Analytics, in GA4, you don’t need to append the hostname to the request URI to see the full URLs in the reports.

You just need to use the ‘Page Location’ dimension in an exploration report.

View ga4 subdomain traffic 1

My best selling books on Digital Analytics and Conversion Optimization

Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.

Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.

Attribution Modelling in Google Analytics and BeyondSECOND EDITION OUT NOW!
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.

Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.

About the Author

Himanshu Sharma

  • Founder, OptimizeSmart.com
  • Over 15 years of experience in digital analytics and marketing
  • Author of four best-selling books on digital analytics and conversion optimization
  • Nominated for Digital Analytics Association Awards for Excellence
  • Runs one of the most popular blogs in the world on digital analytics
  • Consultant to countless small and big businesses over the decade