I am the new one in Google Analytics 4, so I have some (maybe dumb) questions.
I am developing (React.js) website my-app.com
and we have a lot of subdomains like test.my-app.com
, hello.my-app.com
, etc…
Should I have and create a "new property" for every subdomain separately (in a step where you are entering the website URL while creating a property)?
Or GA Dashboard can filter everything automatically by subdomain? What is the best practices?
Any answer, instruction, or link would be helpful.
2
Answers
Yes you can use single GA4 property for sub domains. GA4 automatically handles subdomains, but you need to install GA4 with the same measurement ID on all subdomains. If you want to keep things separate, you can use a different GA4 Measurement ID for each subdomain and deploy a different GA4 tracking code. Here is more explanation.
The best practice to track subdomains in GA4 is to set up a data stream for each subdomain in your GA4 property.
So, in your scenario you will have 1 property and 3 data streams.