By default, Google Analytics 4 (GA4) tracks all subdomains of a website in your account, even with out cross-domain monitoring enabled. That’s helpful if you wish to combination all your firm’s actions all through your subdomains in a single Google Analytics account. Martech Zone, for instance, publishes translated variations of our web site using subdomains for every language revealed.
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 answer. Firms could want to have a Google Analytics account particular to a subdomain and are not looking for 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 simple strategy and provides you essentially the most management over how your information is tracked. To do that, create a brand new GA4 property for every subdomain you need to observe individually. Upon getting created the brand new properties, set up the GA4 configuration tag on the pages of your respective subdomains. In the event you’d nonetheless like one account to combination all subdomains and one other account for a selected subdomain(s), you’ll be able to 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 use GTM to set off a tag based mostly on the subdomain. This technique can present the identical degree of management from a script execution with many extra choices total for controlling your tags. To arrange a set off to fireside on a subdomain solely:
- Click on Triggers > New.
- Give your set off a reputation and outline.
- Below Set off Kind, choose Customized Occasion.
- Below Triggering, click on Add Situation.
- Below Situation Kind, choose URL.
- Below Situation Subject, choose Host.
- Below Situation Worth, enter the subdomain that you really want the set off to fireside on. For instance, if you would like the set off to fireside on the subdomain
weblog.instance.com
, you’d 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 are actually 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 the entire similar performance you’re looking for when wishing to match visitors. Segments can help you filter your information based mostly on a wide range of standards, together with hostname, person properties, and occasion parameters. You may create a section for every subdomain you need to observe individually. Segments don’t work throughout GA4 accounts however they could be a greater strategy than managing a number of accounts.
In GA4, navigate to Discover. You may choose an exploration from the template listing that has the report information you’re in search of, then you’ll be able to customise a section to the particular subdomain.
Create your customized section utilizing Periods.
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 can too construct an viewers utilizing this section (see checkbox within the high proper of the earlier display screen). Audiences and segments in GA4 are each methods to group customers, however they’ve totally 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, that means they’ll present information for all customers who meet the section standards, no matter after they first met these standards.
- Audiences are used for remarketing and reporting in commonplace experiences. They are often based mostly on dimensions, metrics, and occasions, however they don’t seem to be retroactive, that means they’ll solely begin accumulating information for customers who meet the viewers standards after the viewers is created.
On this state of affairs, each are options that may provide help to transfer ahead with reporting in your subdomains.