Integrate Google Analytics
Google Analytics is set per domain: you add your Google Analytics 4 Measurement ID in the domain's Statistics & integration settings, and every project viewed on that domain, including embeds served from it, sends its visits to your Google Analytics property. The setting is not account-wide and not per project, so a project that is reachable on several domains is only tracked on the domains that have the ID.
Adding Google Analytics to a domain
To add Google Analytics to a domain, enter your Measurement ID in the domain's settings. You need the Super admin role to change domain settings.
- Go to
Settings→Domain names. - Click the pencil icon next to the domain you want to track.
- In the
Edit domainwindow, scroll toStatistics & integration. - Turn on
Google Analytics or GTM. - Check that
Integration typeis set toGoogle Analytics. - Paste your Measurement ID (for example
G-XXXXXXXXXX) intoGA4 code. - Optional: turn on
Activate Google Analytics in anonymous mode, so your visitors are not tracked by IP and geo-location. - Click
Save changes.
From then on, visits to projects on that domain are sent to your Google Analytics property. Visits from before you saved are not sent. Repeat these steps for each domain you want to track.
See Statistics & integration settings for your domain for the full section, including how to index the domain for search engines separately.
Finding your Google Analytics Measurement ID
Your Google Analytics 4 Measurement ID is shown in the details of your web data stream in Google Analytics, and it starts with G-. You need Editor access (or higher) on the Google Analytics property to see it.
- Sign in to Google Analytics.
- Click
Admin. - Under
Data collection and modification, clickData streams. - Select the
Webtab and click your web data stream. - Copy the Measurement ID from the first row of the stream details.
If Google's menus look different, see Google's help article Measurement ID for the current steps.
Maglr statistics alongside Google Analytics
By default, the Maglr statistics keep running next to Google Analytics, so you can still see the statistics for each project in the Maglr dashboard. To open them, open the project and click Statistics. This needs Activate standard Maglr statistics to be on in the domain's Statistics & integration section; it is on by default. See Understanding the dashboard statistics for what they show.
Google Analytics and cookie consent
When Activate cookie consent notification is on in the domain's Statistics & integration settings, the domain's Consent mode decides when Google Analytics runs for visitors of that domain:
Strict mode: Google Analytics runs only after the visitor accepts the cookie consent. Visitors who don't accept are not measured in Google Analytics or in the Maglr statistics.Light mode: Google Analytics runs for every visitor, anonymously until the visitor accepts the cookie consent. After the visitor accepts, the more extensive Google Analytics options are activated. IfActivate Google Analytics in anonymous modeis on, Google Analytics stays anonymous after the visitor accepts. The Maglr statistics run for every visitor.Manual mode: you provide the cookie consent overlay yourself through Google Tag Manager. Maglr does not hold Google Analytics back in this mode, so your own consent setup has to control when Google Analytics runs. The Maglr statistics only run after the visitor accepts.
See Configure cookie consent for how to set up the cookie consent.
Frequently asked questions
Do I need to add Google Analytics to each domain separately?
Yes. Google Analytics is set per domain, in the domain's Statistics & integration settings. Projects are only tracked in Google Analytics on domains that have your Measurement ID, so add the ID to each domain you want to track.
Can I use a Universal Analytics (UA-) ID?
No. Google no longer processes Universal Analytics data. Use a Google Analytics 4 Measurement ID, which starts with G-, in the GA4 code field of the domain's Statistics & integration settings.
How do I stop sending data to Google Analytics?
Go to Settings → Domain names, click the pencil icon next to the domain, turn off Google Analytics or GTM in Statistics & integration, and click Save changes. This removes the Measurement ID from the domain. If you turn Google Analytics on again later, enter the ID again.
Why do I get the error "The Google Analytics/Tag Manager code is invalid"?
The code you entered is too short to be a valid ID. Check that you copied the full Measurement ID from Google Analytics, for example G-XXXXXXXXXX.
Can I use Google Tag Manager instead?
Yes. In the domain's Statistics & integration settings, turn on Google Analytics or GTM, set Integration type to Google Tag Manager, enter your container ID (it starts with GTM-) in GTM code, and click Save changes. See Statistics with Maglr for more about the statistics options.
Why can't I see Domain names in Settings?
Domain names is only shown to users with the Super admin role. Ask a Super admin in your account to add Google Analytics to the domain, or to give you that role.
Updated on: 19/10/2026