Articles on: Settings & configurations

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.


  1. Go to Settings → Domain names.
  2. Click the pencil icon next to the domain you want to track.
  3. In the Edit domain window, scroll to Statistics & integration.
  4. Turn on Google Analytics or GTM.
  5. Check that Integration type is set to Google Analytics.
  6. Paste your Measurement ID (for example G-XXXXXXXXXX) into GA4 code.
  7. Optional: turn on Activate Google Analytics in anonymous mode, so your visitors are not tracked by IP and geo-location.
  8. 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.


Paste only the Measurement ID, not the Google tag script. The field accepts a pasted script without an error, but Google Analytics then receives no data.


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.


  1. Sign in to Google Analytics.
  2. Click Admin.
  3. Under Data collection and modification, click Data streams.
  4. Select the Web tab and click your web data stream.
  5. 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.



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. If Activate Google Analytics in anonymous mode is 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