By default, Google Analytics 4 (GA4) tracks all subdomains of a site in your account, even with out cross-domain monitoring enabled. That’s helpful if you wish to combination your whole firm’s actions all through your subdomains in a single Google Analytics account. Martech Zone, for instance, publishes translated variations of our website using subdomains for every language printed.
Inside Google Analytics 4, I can all the time question or filter based mostly on Hostname to restrict my views, however that’s not all the time an optimum reporting resolution. Firms could want to have a Google Analytics account particular to a subdomain and don’t want it included of their combination account.
A number of Google Analytics 4 Accounts
There are a few methods to arrange a number of GA4 accounts and exclude or incorporate subdomains as you’d like:
- Use a separate GA4 property and tag for every subdomain. That is essentially the most easy strategy and provides you essentially the most management over how your knowledge is tracked. To do that, create a brand new GA4 property for every subdomain you wish to monitor individually. After you have created the brand new properties, set up the GA4 configuration tag on the pages of your respective subdomains. If you happen to’d nonetheless like one account to combination all subdomains and one other account for a selected subdomain(s), you possibly can load a number of accounts in a single script tag.
- Use Google Tag Supervisor (GTM). GTM means that you can create extra superior management and filters than GA4. You should utilize GTM to set off a tag based mostly on the subdomain. This technique can present the identical stage of management from a script execution with many extra choices total for controlling your tags. To arrange a set off to fireplace on a subdomain solely:
- Click on Triggers > New.
- Give your set off a reputation and outline.
- Below Set off Sort, choose Customized Occasion.
- Below Triggering, click on Add Situation.
- Below Situation Sort, choose URL.
- Below Situation Subject, choose Host.
- Below Situation Worth, enter the subdomain that you really want the set off to fireplace on. For instance, in order for you the set off to fireplace on the subdomain
weblog.instance.com
, you’ll enterweblog.instance.com
within the Situation Worth area. - Click on Save.
- Add your tags and choose the set off(s) you created. Your tag and set off at the moment are added to your GTM container and can fireplace when a person visits the subdomain that you just specified within the set off.
Various: Google Analytics 4 Segments
Technically, that is NOT using separate accounts however could give you all the identical performance you’re in search of when wishing to match site visitors. Segments permit you to filter your knowledge based mostly on quite a lot of standards, together with hostname, person properties, and occasion parameters. You’ll be able to create a section for every subdomain you wish to monitor individually. Segments don’t work throughout GA4 accounts however they might be a greater strategy than managing a number of accounts.
In GA4, navigate to Discover. You’ll be able to choose an exploration from the template listing that has the report knowledge you’re in search of, then you possibly can customise a section to the precise subdomain.
Create your customized section utilizing Classes.
Throughout the Discover variables, click on the + on Segments to create your section.
Identify your section and add a rule to specify solely together with classes for that subdomain utilizing the Hostname variable.
You may also construct an viewers utilizing this section (see checkbox within the high proper of the earlier display). Audiences and segments in GA4 are each methods to group customers, however they’ve completely different functions and performance.
- Segments are used for evaluation in Explorations. They are often based mostly on any dimension, metric, or occasion in GA4, and they’re retroactive, which means they are going to present knowledge for all customers who meet the section standards, no matter after they first met these standards.
- Audiences are used for remarketing and reporting in customary experiences. They are often based mostly on dimensions, metrics, and occasions, however they don’t seem to be retroactive, which means they are going to solely begin accumulating knowledge for customers who meet the viewers standards after the viewers is created.
On this state of affairs, each are options that may enable you transfer ahead with reporting in your subdomains.