Google tracking setup: GA4, Tag Manager and Search Console, step by step
Note
For people running migrations (freelancers, agencies, developers), and for site owners who want the
exact clicks. The plain-language version is Analytics and tags.
Why wp2next recommends this stack, the alternatives and the consent rules are in
Tracking and search.
This page walks through the Google side of a wp2next site in the order you do it: Google Analytics 4
(GA4), Google Tag Manager (GTM), Search Console, the links between them, and Bing Webmaster Tools.
The Google stack is recommended, not required. wp2next proposes it during migrate and you can
pick another analytics tool, or none (see Choosing a tracking stack).
Search Console and Bing are worth setting up whatever you pick: skip straight to
step 8 if you don't use GA4 or GTM.
Every click path on this page was checked against Google's, Microsoft's and Vercel's help pages in
December 2026 (checked 2026-12), with the source linked under each step. Google renames menus often.
Steps marked Not yet confirmed weren't confirmed on an official page, and the words on your screen may
differ: look for the nearest match. Everything here happens in a web browser, so it's the same on
macOS and Windows, except the DNS check in step 8, which has a block for each.
The business should create and own every Google property (GA4, GTM, Search Console, Google Ads). This
is best practice, not a Google rule, but it saves a painful transfer later (Handing a site over to the client).
Sign in with a Google Workspace address on the business's own domain, for example
marketing@example.com, if the business has Google Workspace. Otherwise create a dedicated business
Gmail account. Avoid one person's private inbox.
Add a second person from the business as an administrator on each product, so nobody gets locked out
when someone leaves.
People helping with the site (an agency, a freelancer, a developer) get their own access by
invitation, never the business's password. See step 2.
Each Google product has a container for the business and a smaller one per website. Put each new site
in the business's own account, as its own property:
Product
The business gets
Each website gets
GA4
One account
One property with one web data stream
Tag Manager
One account
One container (target platform: Web)
Search Console
(no account level)
One Domain property, for example example.com
Don't add a client's site to an agency's own GA4 or GTM account, and don't add it to another
business's account. Access to the account level reaches every property in it
(GA4 access (external site)).
Don't put two websites in one GA4 property. Their numbers mix and can't be separated afterwards.
Reuse what already exists. If the WordPress site already has a GA4 property, keep it: a new
property starts with no history. Moving a property that sits in the wrong account is covered in
Handing a site over to the client.
Already has an account for this business: go to Admin → Create → Property and skip to
step 3. To create a new account instead: Admin → Create → Account.
Account: enter the business name as the account name, review the data-sharing settings, click
Next.
Property: enter a property name (the domain works well), the reporting time zone and the
currency → Next → choose the industry category and business size → Next →
choose how you plan to use Analytics → Create → accept the Terms of Service and the Data
Processing Amendment.
Web data stream: Admin → Data collection and modification → Data streams → Add stream
→ Web. Enter https://example.com and a stream name. Leave Enhanced measurement on
(step 3 below adjusts it) → Create stream.
Copy the Measurement ID: Admin → Data streams → click the stream → under Stream details,
copy the ID that starts with G-. wp2next asks for it.
Don't add the Google tag code Google offers at the end. On a wp2next site GA4 is loaded by Tag Manager,
from the container you import in step 5.
Invitations go to the helper's own Google account. Never share the business's password or a 2-step
verification code, and don't let anyone sign in "as" the business. Each product has its own invite
screen, so do this for each product once it exists (GTM after step 4, Search Console after step 8).
Settings → Users and permissions → Add user → email → permission
Full. To link GA4 (step 9) they must be a verified owner, so either the business makes the link or the helper verifies with their own TXT record; a delegated Owner is not enough
The business's Ads account links to the helper's manager (MCC) account: Admin → Access and security → Managers. Path Not yet confirmed (check in the UI)
Manager link (the business can remove it any time)
GA4 names Administrator, Editor and Viewer roles on its access page. Creating a new event as a key
event needs Marketer or above, and linking Google Ads needs Editor or Administrator. Editor
covers everything on this page except managing users. Only email addresses tied to a Google Account
can be added. The last Administrator can't remove themselves.
Search Console has four levels: Owner, Full, Restricted and Associate. An owner can add another
delegated owner directly.
Search Console allows 100 non-owner users per property.
The helper accepts each invitation by email. What the business sends the helper is: the accepted
invitations, the domain, who runs DNS, and the time zone and currency. No passwords.
Admin → Property → Data Settings → Data Retention. Your screen may show these under Data
collection and modification instead (label Not yet confirmed). Needs Editor.
Set Event-level data to 14 months (standard properties offer 2 or 14) → Save.
There is a separate User-level data setting (also 2 or 14 months). Key-event data follows that
one, so set it to 14 months too.
It affects Explorations and funnel reports, not the standard reports. Google waits 24 hours before
applying a change, and you can undo it in that window. A reduction deletes data at the next monthly
deletion.
Admin → Data streams → your stream → the Enhanced measurement gear:
Turn Form interactions off. It can fire on submits that didn't succeed (Not yet confirmed). The wp2next site
sends generate_lead itself, only when a form is sent successfully.
Leave Page changes based on browser history events on. A wp2next site changes pages without a
full reload, and this is how GA4 counts those page views.
Admin → Data streams → your stream → Configure tag settings → Show more → Define internal
traffic → Create. Keep traffic_type = internal, choose the IP match type, enter the office
IP address → Create.
Admin → Data filters → Create filter → Internal traffic → Exclude. Leave the state on
Testing for a few days.
Once the test looks right, switch the filter to Active. Filters take 24–36 hours to start
working, and data an active filter excludes is gone for good.
The same list has a Developer traffic filter, which removes debug-mode visits such as Tag Assistant
sessions.
If visitors pass through another domain on the way to a lead (a booking or payment site), add it under
Configure tag settings → Configure your domains.
(Google (external site), checked 2026-12)
Before any data arrives: Admin → Data display → Events → + Create event → enter the exact
name generate_lead → turn on Mark as key event. Needs Marketer or above.
After the event has fired once: Admin → Data display → Events, then click the star next to
generate_lead (in the Recent events tab, or search for it). Needs Editor or above.
Add contact_click too if the business counts phone and email taps as leads. To count only phone
taps, create an event named for example phone_click that matches event_name = contact_click
and method = phone, and mark that one instead.
Counting starts when you mark the event, with no backfill. Key events show in Realtime within a few
minutes and in standard reports within 24 hours. A standard property allows 30 key events.
Register the event parameters as event-scoped custom dimensions (Admin → Custom definitions)
so they show in reports: method, link_location, and the lead parameters (form_type,
form_location by default). (Google (external site))
If the business has no Tag Manager account: Create account → account name (the business) and
country. If it has one, open it and choose to create a new container.
Container name: the domain. Target platform: Web → Create → accept the terms.
Close the install-code window. wp2next adds the container to the site itself.
Copy the container ID (GTM-XXXXXXX) from the top of the workspace. wp2next asks for it.
If the WordPress site already uses a container, you can reuse it. Read the warning in
step 7 first.
wp2next writes a ready-made container file with every tag, trigger and variable your site needs: the
GA4 tag and events, Google Ads conversions if you use Ads, and any extra tags you chose. You import it
instead of building tags by hand.
migrate generates it during phase 5. To generate it again after a change (a new ID, a new tag), open
your site's project and run the tracking command. It asks for any ID it doesn't have yet.
For Claude desktop
Open the Claude desktop app, click Code, choose Local and your site's project folder with
Open folder…, then type:
Text
/wp2next:tracking
Text
/wp2next:tracking
Text
$wp2next tracking
Text
/wp2next tracking
(In Claude, type /wp2next tracking if you installed wp2next without the plugin.)
It writes two files in the project folder:
docs/analytics/gtm-container.json: the import file.
docs/analytics/README.md: a checklist for your exact setup, including anything still to do.
Read what it reports. PENDING lines are IDs you haven't given yet, and those tags aren't in the file.
MANUAL lines are tags you need to add by hand. Don't edit the JSON file by hand; rerun the command
instead. More on the command: wp2next tracking.
In Tag Manager, open the container → Admin → Import container.
Choose container file → go to your project folder → docs → analytics →
gtm-container.json. If you can't find the folder, ask your AI tool where the project is, or to open
the docs/analytics folder for you.
Choose Existing workspace: Default Workspace.
Choose Merge, then Rename conflicting tags, triggers, and variables. This is safe for any
container: nothing that's already there is replaced. (Overwrite replaces the whole container;
only use it on a brand-new, empty one.)
Click Continue, read the summary of what will be added or changed, then click Confirm.
Imported tags reach the site only when you publish (step 7).
If you change something later and regenerate the file, import it again the same way. Renamed
duplicates (with a suffix) mean a tag existed under the same name: delete the older copy.
wp2next connects the banner (a CMP) in one of two ways, and docs/analytics/README.md says which one
your site uses:
Script in the site's code: nothing to add in Tag Manager. The site sets the "denied" defaults,
then loads the banner, then Tag Manager.
Tag Manager template: add the banner here:
Templates → Tag templates → Search gallery, and find your banner service's template
(gallery labels Not yet confirmed; the template names are in the
comparison table). Check the publisher name
before adding it.
Tags → New → choose the template → enter the site ID from the banner service.
Set the default (denied) consent for the EU, UK and Switzerland in the template's settings.
Trigger: the built-in Consent Initialization - All Pages. Only consent tags use this trigger.
Either way:
Never add a Custom HTML tag that sets consent defaults, and never set defaults in both the site and a
template. wp2next's container doesn't include one.
Turn on Admin → Container Settings → Additional Settings → Enable consent overview. A shield
icon then appears on the Tags list and shows which consent each tag waits for.
Consent Mode v2 has four signals: ad_storage, analytics_storage, ad_user_data and
ad_personalization. Google's tags read them automatically. The other tags in wp2next's container
are already set to wait for the right consent (Tag → Advanced Settings → Consent Settings).
If the WordPress site uses the same container, publishing changes the live WordPress site's tags
too. Publish only at launch, or use a new container for the new site. migrate tells you before it
asks you to publish (step 7: Go live).
Until launch, analytics is switched off on the preview site on purpose. During go-live, the AI tool
turns it on for the private Vercel address first, so you can test there before the domain moves.
Choose Publish and Create Version, enter a version name (for example "v1 launch") and a
description.
Click Publish.
Publishing needs Publish permission on the container (standard Tag Manager behavior; the help page
doesn't state it outright). Create Version (finished with Create) saves a snapshot without
making it live.
In August 2026 Google announced that Google tags and Tag Manager are merging
(Google (external site), checked 2026-12):
Containers get a simpler Overview page with a Settings tab for container-wide settings. Triggers,
Variables, Templates and Folders move into a new Advanced section. If a menu on this page isn't
where we say, look there.
Editors may see a banner offering to optimize the container. Google says no changes are made
automatically by this flow; you can preview first. If you accept it, test again in Preview before
publishing, and check the consent settings, which Google's page doesn't cover.
Google's page doesn't say clearly whether the upgrade of standalone Google tags is automatic, and
gives no date. A report of a January 2027 upgrade date is Not yet confirmed.
Importing the wp2next container still works the same way.
Go to google.com, search.google.com, search console (external site) signed in as the
business → Add property → Domain → enter example.com (no https://, no www). Labels
Not yet confirmed. A Domain property covers every version of the site: with and without www, http
and https.
Copy the TXT record Google shows (it starts with google-site-verification=). Leave the page open.
Add it where the domain's DNS is managed (not necessarily the registrar): Type TXT, Name/Host
blank or @ (whichever the DNS host uses for the domain itself), Value = the string. Add a
new TXT record. Don't edit or replace an existing TXT record, especially one starting
v=spf1 (the domain's email SPF): a domain can have several TXT records at @, and overwriting
the SPF record sends the business's email to spam or gets it rejected. Save a copy (export or
screenshot) of the DNS records before adding anything
(DNS cutover → Copy every record).
DNS on Vercel (the domain uses Vercel's nameservers): Vercel dashboard → Domains → click
the domain → on its Advanced Settings page click Enable Vercel DNS → in the DNS record form,
Name blank, Type TXT, Value the string, TTL 60 (the default) → Add.
(Vercel (external site), checked 2026-12) Or from the
project folder:
Terminal
vercel dns add example.com '@' TXT "google-site-verification=..."
Anywhere else (registrar, Cloudflare, old web host): add a TXT record in that provider's DNS
settings. The DNS cutover guide covers finding the DNS host.
Back in Search Console, click Verify. Google says a new record can take 2–3 days to start
working. If it fails, wait a day or two and try again.
Never delete this TXT record, now or when DNS moves. Search Console re-checks it and you lose
verification without it. If DNS moves to Vercel later, copy it over with every other record.
Sitemap: Indexing → Sitemaps → enter sitemap.xml → Submit (labels Not yet confirmed).
URL Inspection: paste a page address into the search bar at the top. Test live URL checks the
page as it is now; Request indexing asks Google to crawl it again (labels Not yet confirmed).
Search generative AI: Settings → Search generative AI controls whether the site appears in AI
Overviews, AI Mode and generative features in Discover. The options are Include (the default),
Exclude and Inherit control from parent. Google says it isn't used as a ranking signal for
regular Search. Leave it on Include unless the business decides otherwise.
(Google (external site), checked 2026-12)
The Performance report has a Generative AI view with impressions only (no clicks or queries).
(Google (external site), checked 2026-12)
If the old site already had a URL-prefix property in Search Console, keep it alongside the new Domain
property; its history stays there.
GA4 Admin → Product links → Search Console links → Link. You need Editor in GA4 and must be a
verified owner of the Search Console property (step 2). One Search Console property links to one web
stream. A link can't be edited, only deleted and created again. Then open GA4's Library and publish
the Search Console report collection, which is hidden by default.
(Google (external site), checked 2026-12)
GA4 Admin → Product links → Google Ads links → Link → choose the Ads account → Confirm →
Next. Personalized advertising is on by default. Expand Enable auto-tagging and turn it on, or
leave the current setting if the Ads account already handles it → Next → Submit. You need
Administrator or Editor in GA4 and Admin in Google Ads.
(Google (external site), checked 2026-12)
After linking, check Admin → Key events (path: check in the UI): on a lead-generation site, only
lead events such as generate_lead should be marked. Whether linking marks any events by itself is
Not yet confirmed.
Simple default: import the GA4 key event generate_lead into Google Ads as a conversion. Only
key events can be imported. Imported conversions may start as secondary (Not yet confirmed); make the
lead conversion primary if Ads should bid on it.
Ads conversion tag: if you gave wp2next an Ads conversion ID and label, the container already
holds a Google Ads conversion tag. Google suggests this route (with enhanced conversions) when you
need Ads-specific features or don't use GA4.
Count each lead once. Make either the imported GA4 key event or the Ads tag the primary
conversion, never both.
Choose Import (from Google Search Console) on My Sites or Add a site.
Sign in with the Google account that has the Search Console property → Allow → pick the site →
Import.
This verifies the site and brings in its sitemaps, not Search Console's data. Bing re-checks through the
Search Console connection; if you remove that access later, verify again with a DNS record or meta tag.
Labels are Not yet confirmed (Microsoft's announcement is from 2019:
Bing (external site)).
GA4 Realtime (Reports → Realtime, path Not yet confirmed): open the live site from a network that
isn't filtered as internal, for example a phone on mobile data, and accept the banner if there is
one. Your visit should appear within a minute or two.
GA4 DebugView: Admin → Data display → DebugView. Tag Assistant sessions appear here
automatically. The Seconds stream covers the last 60 seconds, the Minutes stream the last 30
minutes. (Google (external site), checked 2026-12)
Send one real test message through the site's form: onegenerate_lead should appear.
Key events appear in standard reports within about 24 hours. Search Console data takes a few days.
Switch the internal-traffic filter from Testing to Active once you've checked it (step 3).
The full launch checklist, for every analytics tool, is in
Tracking and search.