Sub topic 6
Install through a website platform integration
This chapter covers the second installation route: letting your website platform add the Google tag for you. You paste a Measurement ID into a settings field, or connect your Google account, and the platform places the tag on your pages.
It assumes you already have a GA4 property with a web data stream and know where to find its Measurement ID (the G-XXXXXXXXXX value). It also assumes you know what the Google tag does and why a page can end up with more than one copy of it.
What a platform integration does
A platform integration is a feature of a content management system (CMS), website builder, or e-commerce platform that installs the Google tag without you editing templates. Two mechanisms are common:
- ID field. The platform shows a box labeled something like "Google Analytics" or "Measurement ID". You paste the ID, and the platform injects the standard tag into the head of every page.
- Account connection. A plugin or app signs in to your Google account, lists your properties, and configures the tag itself. Google's Site Kit plugin for WordPress works this way. Shopify's Google & YouTube app also works this way.
Both produce the same result in the browser. The page loads gtag.js from googletagmanager.com and calls gtag('config', 'G-XXXXXXXXXX'). What differs is who controls the code, and how much you can customize it.
When this route fits
Choose a platform integration when:
- you do not have access to the theme or template files, as on many hosted builders
- the platform's own integration is maintained and supports the features you need, such as e-commerce events
- nobody on the team needs custom tags beyond GA4
Prefer manual installation or Google Tag Manager when you need precise control over load order (for example consent defaults), custom triggers, or several tools managed in one place.
Typical setup steps
The exact menu names differ by platform and change over time. The sequence is stable.
- Get the Measurement ID. In GA4, open Admin, then Data streams, then select your web stream. Copy the Measurement ID at the top right. It starts with
G-. - Open the analytics settings in your platform. Look under names such as Marketing, Integrations, Tracking, Settings, or Developer tools.
- Enter the ID or connect the account. Paste only the Measurement ID. Remove any spaces.
- Save and publish. Many builders only apply integration changes after you publish the site. Saving a draft is not enough.
- Check for older tags. Search for existing installations before you finish (see the duplicate section below).
- Verify. Visit the live site and confirm hits arrive in the Realtime report.
Examples by platform
The table lists where each platform usually puts the setting. Treat it as a map, not a guarantee, because vendors rename menus.
| Platform | Usual method | What you provide |
|---|---|---|
| WordPress | Site Kit by Google, or another analytics plugin | Sign in with Google, or paste the ID, depending on the plugin |
| Shopify | Google & YouTube sales channel app | Connect the Google account and choose the GA4 property |
| Wix | Marketing or tracking integrations section | Measurement ID |
| Squarespace | Analytics or developer settings | Measurement ID |
| Webflow | Site settings, integrations or custom code area | Measurement ID |
GA4 also shows platform-specific hints in the data stream's installation instructions. Open the stream, choose the installation instructions, and look for the option to use a website builder or CMS.
What the integration does not do for you
Platform integrations install the tag. They do not configure everything around it.
- Property settings stay in GA4. Enhanced measurement, data retention, internal traffic filters, and key events are set in the GA4 Admin area, not in the platform.
- Consent is not guaranteed. A basic ID field usually loads the tag as soon as the page loads. If you need consent defaults to run first, check whether the platform or its consent banner supports Google consent mode. Otherwise use Tag Manager or a manual install.
- E-commerce events vary. Some integrations send
purchaseandadd_to_cartevents. Others send only page views. Compare the events in DebugView with what you expect. - Customization is limited. You usually cannot add parameters to the
configcall, such asdebug_mode, through an ID field. You may need a custom code injection area.
Adding code when the integration is not enough
Many platforms offer a header code injection area, which can hold a custom snippet. If you need to set a consent default and the platform injects its own tag, the order matters. The consent default must run before the first config call.
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('consent', 'default', {
ad_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
analytics_storage: 'denied'
});If the platform places its tag before your injected code, the tag may send data before the default applies. When ordering is not under your control, move to Tag Manager or a manual install.
Avoiding duplicates after installing
The most frequent platform error is a second copy of the tag. Typical sources:
- The theme already contains a hard-coded snippet, and you added the integration on top.
- Two plugins both inject analytics, for example Site Kit and a separate analytics plugin.
- A Tag Manager container contains a Google tag for the same ID, while the platform also injects one.
- The platform integration has been left on while a developer pasted the tag manually.
Symptoms include page view counts roughly double what you expect, and every event appearing twice in DebugView. These symptoms can also come from the same ID being configured in two different places, so check for that too.
Check from the browser
Open the live site, open the browser developer console, and run this script. It lists the Measurement IDs requested by gtag.js script elements, and the IDs passed to config calls.
const scriptIds = [...document.querySelectorAll('script[src*="googletagmanager.com/gtag/js"]')]
.map(s => new URL(s.src).searchParams.get('id'));
const configIds = (window.dataLayer || [])
.filter(entry => entry[0] === 'config')
.map(entry => entry[1]);
console.log('gtag.js script IDs:', scriptIds);
console.log('config call IDs:', configIds);Read the output like this:
- One script ID and one
configID, both the same: normal. - The same ID repeated in
configIds: the tag is configured twice, so you are probably double counting. - Two different
G-IDs: two properties receive data. This may be intentional, but it often is not. - A
GTM-container ID that appears in the script list indicates Tag Manager is also present. Open the container and check whether it contains a Google tag for the same ID.
The script only sees what is in the page. It cannot detect a duplicate that is added later by a script after your snippet ran, so rerun it after the page has fully loaded.
Verifying the integration
After you publish, verify in three places. Each answers a different question.
- Realtime report. Open your site in a separate tab and watch for your visit in GA4's Realtime report. This confirms that data reaches the property.
- Tag Assistant. Connect Tag Assistant to the site. It lists the Google tags it finds, and flags configuration problems. If it finds the same tag twice, you have a duplicate.
- DebugView. Events are shown in detail only for debug devices. Many platform integrations do not let you set
debug_modein the config call. The Tag Assistant connection or the Google Analytics Debugger browser extension can turn on debug mode for your session without code changes.
Realtime shows a delay of a few seconds. Standard reports can take 24 to 48 hours to populate, so use Realtime and DebugView for installation checks, and do not judge success from standard reports on day one.
Common errors and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
| No data at all | Changes saved but not published | Publish the site, then reload |
| No data at all | A `UA-` ID or a typo in the ID | Paste the `G-` ID from the web data stream |
| No data at all | Ad blocker or browser privacy setting blocks `gtag.js` | Test in a clean browser profile without extensions |
| Double page views | Theme snippet plus integration | Remove one copy |
| Your own visits distort numbers | No internal traffic filter | Define internal traffic in the GA4 property |
| Data goes to the wrong property | The integration was connected to a different stream | Reconnect and select the correct property and stream |
| Consent default ignored | Platform tag loads before your injected code | Use Tag Manager or a manual install |
When to leave the integration behind
An integration is not permanent. Move to a manual or Tag Manager install when:
- you need event parameters or triggers the platform does not expose
- you must control the order in which consent and configuration run
- several teams edit tracking and need versioning and a publishing workflow
- the plugin is unmaintained, or conflicts with another plugin
When you migrate, remove the integration first or at the same time as you add the new tag. Adding the new tag and leaving the old one for "a day or two" is a common way to create duplicate data that cannot be removed from reports afterward.
Exercise
You enable a platform's Google Analytics field with your Measurement ID. Realtime shows each of your page views twice, and the console script prints the same G- ID twice in configIds. Name two likely causes and what you would do next.
Show answer
Likely causes are a hard-coded Google tag in the theme (or a second plugin) that also configures the same ID, or a Tag Manager container containing a Google tag for that ID. Identify every place that injects the tag, such as theme files, plugins, and containers. Choose one intended source, remove the others, publish, and then re-run the console script and confirm the ID appears once and Realtime shows one page view per visit.
Exercise
A colleague pasted UA-12345678-1 into the platform's analytics field. The site is published and traffic is normal, but the GA4 Realtime report is empty. What is wrong, and what do you do?
Show answer
A UA- ID belongs to Universal Analytics, which no longer processes data, so nothing reaches the GA4 property. Open Admin, then Data streams, copy the G- Measurement ID from the web stream, paste it into the platform field, publish, and check Realtime again.