By default, Google Analytics 4 (GA4) tracks all subdomains of a website in your account, even with out cross-domain monitoring enabled. That is helpful if you wish to consolidate all your firm’s exercise throughout your subdomains right into a single Google Analytics account. For instance, Martech Zone publishes translated versions our web site utilizing subdomains for every revealed language.
In Google Analytics 4 I can at all times run a question or filter based mostly on hostname to restrict my views, however that is not at all times an optimum answer for reporting. Firms could wish to have a Google Analytics account particular to a subdomain and never need it included of their total account.
A number of Google Analytics 4 accounts
There are a number of methods to arrange a number of GA4 accounts and exclude or embrace subdomains as wanted:
Use a separate GA4 property and tag for every subdomain. That is the best strategy and offers you probably the most management over how your information is tracked. To do that, create a brand new GA4 property for every subdomain you wish to monitor individually. After you create the brand new properties, set up the GA4 configuration tag in your respective subdomains’ pages. When you nonetheless need one account to combination all subdomains and one other account for a number of particular subdomains, you are able to do that Load multiple accounts in a single script Label. Use Google Tag Supervisor (GTM). GTM permits you to create extra superior management and filtering options than GA4. You should utilize GTM to set off a tag based mostly on subdomain. This technique can present the identical stage of management as operating a script and total present many extra choices for controlling your tags. To arrange a set off to solely fireplace on a subdomain: Click on Triggers > New. Give your set off a reputation and outline. Underneath Set off sortselect Customized occasion. Underneath Set offclick on Add situation. Underneath Situation sortselect URL. Underneath Situation disciplineselect host. Underneath Situation worthEnter the subdomain the place you need the set off to fireside. For instance, if you need the set off to fireside on the weblog.instance.com subdomain, enter weblog.instance.com within the discipline Situation worth Subject. Click on Save. Add your tags and choose the triggers 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 you specified within the set off.
Different: Google Analytics 4 segments
Technically that is NOT utilizing separate accounts, however chances are you’ll get the identical options you want if you wish to evaluate visitors. Segments mean you can filter your information based mostly on numerous standards, together with hostname, person properties, and occasion parameters. You may create a section for every subdomain you wish to monitor individually. Segments do not work throughout GA4 accounts, however could also 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 incorporates the report information you are searching for after which customise a section to the particular subdomain.
Create your customized section utilizing classes.
Within the Discover variables, click on the + for segments to create your section.
Title your section and add a rule to make use of the hostname variable to specify that solely classes for this subdomain are included.
It’s also possible to construct an viewers utilizing this section (see the checkbox on the prime proper of the earlier display screen). Audiences and segments in GA4 are each methods to group customers, however have totally different functions and capabilities.
Segments are used for evaluation in explorations. They are often based mostly on any dimension, metric, or occasion in GA4 and are retrospective, that means they show information for all customers who meet the section standards, no matter once they first met these standards. viewers are used for remarketing and reporting in normal experiences. They are often based mostly on dimensions, metrics, and occasions, however they aren’t retroactive, that means they solely begin gathering information for customers who meet the viewers standards after the viewers is created.
On this situation, these are each options that may provide help to advance reporting on your subdomains.