Tracking and search: analytics, consent and Search Console
For people running migrations (freelancers, agencies, developers). Moving your own site? See the plain-language version. For exact clicks in GA4, Tag Manager and Search Console, see Google tracking setup.
During migrate, wp2next asks three questions about measurement and suggests an answer for each:
- Which analytics tool? It suggests the Google stack: Google Analytics 4 (GA4) loaded through Google Tag Manager (GTM). You can pick something else, or nothing.
- Do you need a consent banner? If the site has one already, wp2next finds it in the WordPress copy and suggests keeping it.
- Search Console? Always suggested (Google, plus Bing), whatever you pick for analytics. It's free and it's the only way to see how search engines treat the site.
This page explains each choice, what to ask the client for, how to set each piece up, and what to check
after launch. Facts were checked in December 2026 against the linked vendor docs. These products change
often, and anything marked unverified wasn't confirmed on an official page. Nothing here is legal
advice: run wp2next compliance before launch (see Compliance: privacy, consent, accessibility and form checks) and ask a lawyer when
it matters.
Choosing a tracking stack
The options
| Stack | Pick it when | Main trade-off |
|---|---|---|
| Google stack: GA4 + GTM + Search Console (recommended) | The business runs, or might run, Google Ads. Also the safe default when nobody has a strong opinion. | Needs a consent banner and Google Consent Mode v2 for visitors from the EU, UK or Switzerland. |
| HubSpot only | HubSpot is the CRM and the business cares more about "which visit became which lead and deal" than about traffic detail. | Not cookieless. Google Ads conversion sync needs a paid Marketing Hub plan (Starter or above). No GA4-style funnels or explorations. |
| Privacy-first: Plausible or Fathom | Most visitors are in the EU or UK, nobody relies on Google Ads, and the client wants a simple dashboard. | No Google Ads conversion data. "No banner needed" is the vendor's claim, not a legal ruling. |
| Matomo | The client wants GA4-level depth but owns the data, or must self-host. | More setup; some features are paid add-ons when self-hosted. |
| PostHog | The client also wants funnels, session replay and product analytics in one tool. | More than a small brochure site usually needs. |
| Vercel Web Analytics | You only need simple traffic counts and the site is already on Vercel Pro. | No custom events on Hobby; UTM reports need a paid add-on. No ad attribution. |
| None | The client explicitly doesn't want analytics. | Search Console still works and is still recommended. |
Why the Google stack is the default. GA4's key events feed Google Ads bidding directly, GA4 links to Search Console natively, and both are free. GTM lets the client add or remove marketing tags (Meta, LinkedIn, Clarity, HubSpot) later without a developer.
If you drop GA4 but run Google Ads, Ads still needs its own conversion signal, or automated bidding loses track of leads. Options: the Google Ads conversion tag (through GTM or directly), Enhanced Conversions for Leads, or HubSpot's conversion sync. HubSpot's sync allows up to 5 events on Marketing Hub Starter, 50 on Pro and 100 on Enterprise, and doesn't work through manager (MCC) accounts (checked 2026-12, HubSpot (external site)).
Hybrids
You can pick more than one analytics tool (tracking.analytics accepts a list). Common combinations:
- GA4 + GTM for Google Ads, plus Plausible or Fathom as a clean, privacy-friendly dashboard for the client.
- GA4 + GTM, plus HubSpot for lead attribution in the CRM. HubSpot's tracking code goes into GTM as one more tag.
- GA4 + GTM, plus Microsoft Clarity for heatmaps and session recordings. Clarity is an add-on, never the main analytics tool.
Every extra tool is another script for visitors to download, another vendor to list in the privacy policy, and another thing to cover in the consent banner. Add one only when someone will actually look at it.
Prices and limits (checked 2026-12)
| Tool | Free option | Paid from | Cookieless | Search Console data inside the tool |
|---|---|---|---|---|
| GA4 | Free | — | No | Yes, via the GSC link |
| HubSpot | Free CRM tools: up to 2 users, 10 dashboards, 30 days of dashboard history (pricing (external site)). Whether the traffic report is in the free tier is unverified | Marketing Hub Starter for Ads sync | No (__hstc, hubspotutk and others; cookies (external site)) | Unverified |
| Plausible | 30-day trial; self-hosted Community Edition (free, unverified on the pricing page) | $9/month for 10k pageviews (pricing (external site)) | Yes | Yes (docs (external site)) |
| Fathom | 7-day trial (card needed) | $15/month for 100k pageviews (pricing (external site)) | Yes | Yes, every plan |
| Matomo | Self-hosted On-Premise is free | Cloud from €29/month for 50k hits (pricing (external site)) | Optional (disableCookies) | Paid add-on self-hosted; included in Cloud |
| PostHog | 1M events and 5k replays a month (pricing (external site)) | Usage-based | Optional (cookieless_mode) | Unverified |
| Vercel Web Analytics | Hobby: 50k events/month, no custom events (limits (external site)) | Pro: $0.03 per 1k events; UTMs need Web Analytics Plus ($10/month per team) | Vercel says yes (unverified) | No |
Remember that Vercel's Hobby plan is for non-commercial sites only (see Accounts and plans), so a business site is on Pro anyway.
"Cookieless" doesn't automatically mean "no consent needed" in the EU. Matomo's own FAQ notes that strict ePrivacy rules can treat any tracking script like a cookie (Matomo (external site)).
Tag Manager or direct?
- GTM (
tracking.tagManager: "gtm") is recommended whenever you use GA4 or any marketing tag. The site loads only GTM, and/wp2next trackingwrites an import file with every tag already configured. - Direct (
"none") suits a site with only Plausible, Fathom, Matomo, PostHog, Vercel Analytics or HubSpot and no ad pixels. The site loads that tool's script itself, only in production and only after consent where consent is required.
Either way the site sends the same three events:
generate_leadwhen a form is successfully sent (not when the button is clicked), with parameters that say which form it was (form_type,form_location, and any others listed intracking.leadParams).contact_clickwhen someone taps a phone number or email link, withmethod(phoneoremail),contact_value(the number or address) andlink_location(header,footerorbody). There is one event for both: to count only phone taps, filter or build a key event onmethod = phone.virtual_page_viewwhen a visitor moves to another page without a full reload (tools that track page changes themselves, like GA4, ignore it).
With GTM they go to the data layer; without it they go straight to the chosen tool's event API. Tools
with their own naming get readable names: Plausible goals Lead and Contact Click, Fathom events
lead and contact click.
How it fits into a wp2next site
- The page code never contains tracking snippets. One small analytics component loads GTM or the chosen tool, and one helper sends the three events above.
/wp2next tracking(ormigrate) writes:docs/analytics/gtm-container.json, the file you import into GTM (only when you use GTM)docs/analytics/README.md, a checklist for your exact setup
- Your choices are saved in the project's
wp2next.jsonundertracking:analytics,tagManager,searchConsole(google,bing),cmp,consentand the extra tags. Change them and run/wp2next trackingagain. - Until launch, the preview site has analytics switched off (
NEXT_PUBLIC_DISABLE_ANALYTICS=1) and asks search engines not to index it. Both are turned on during cutover.
What to ask the client for
Send this list early. Access takes longer to arrange than anything else. Ask the client to create accounts under their own login and invite you, so nothing has to change owner later (see Handing a site over to the client). Access is always by invitation to your own Google account, never by sharing the client's password; each product's invite screen is in Google tracking setup.
- Admin access to their existing analytics: GA4 property (Admin > Property access management), HubSpot portal, Plausible or Fathom site, and so on
- Admin or Publish access to their existing GTM container, if they have one
- Owner access to their Search Console property, if they have one
- Google Ads: account access, plus which actions count as a lead (form, call, email)
- IDs for any other ad or analytics tools they use (see Extra tags)
- Their consent banner account (Termly, CookieYes, Cookiebot...), if they have one
- DNS access: who controls the domain's DNS, so you can add a verification record
- Office IP addresses, so staff visits can be filtered out
- Any other domains visitors pass through, like a booking or payment site
- Whether they get visitors from, or advertise to, the EU, UK or Switzerland (this decides the consent setup)
If something already exists, reuse it. A new GA4 property starts with no history.
Setting up the Google stack
The click-by-click setup, with a checked source for every menu path, is in Google tracking setup: which account each property belongs in, GA4, the GTM import, Consent Mode with a CMP template, Preview and Publish, Search Console, the product links and Bing. This section only lists the wp2next-specific decisions it walks through.
1. GA4
- One property per site, with one web data stream, in the client's GA4 account, never in yours. Reuse the existing property if there is one. (setup)
- Set data retention (Event-level data and User-level data) to 14 months on day one. (setup)
- Enhanced measurement: Form interactions off (the site sends
generate_leaditself, only on success); Page changes based on browser history events on. - Key events:
generate_lead, pluscontact_click(or a phone-onlyphone_clickderived from it) if the client counts calls and emails as leads. Registermethod,link_locationand the lead params as event-scoped custom dimensions. (setup) - Internal-traffic filter for the office IPs, tested before it goes Active, and any other domains in the visitor's path (booking, payments) under Configure your domains.
2. Google Tag Manager
- Create a Web container in the client's GTM account, or use the existing one. Note the container
ID (
GTM-…). - Run
/wp2next tracking(or letmigratedo it). It asks for any IDs it doesn't have yet and generatesdocs/analytics/gtm-container.json. - Import it: Admin > Import Container > Merge > Rename conflicting tags, triggers, and variables. Overwrite only on a new, empty container. (setup)
- Preview: each tag fires once, including after a client-side page change. Then publish. (setup)
If WordPress uses the same container, publishing changes WordPress's tags too: publish at launch. Google's August 2026 Tag Manager changes (a Settings tab, an Advanced section, an optional "optimize" flow) are summarized in the setup guide.
3. Google Ads (if used)
- In Google Ads, create a conversion action for each lead type, choosing Website and setting it up with Google Tag Manager. Automatically created actions have no label and can't be used.
- Copy the Conversion ID and Conversion Label for each action. wp2next puts them in the GTM file, along with the Conversion Linker and remarketing tags. (docs (external site))
- Link GA4 and Google Ads, with auto-tagging (setup).
- Count each lead once. Either the Ads conversion tag or the imported GA4 key event is the "primary" conversion for bidding, not both.
- After linking, GA4 may mark shopping events (like
add_to_cart) as key events. Unmark them on a lead-generation site.
Setting up other analytics tools
wp2next loads these directly (or through GTM if you also use it) and sends the same three events. You need one ID or snippet from each; the assistant asks for it in phase 5.
| Tool | What wp2next needs | Notes |
|---|---|---|
| HubSpot | Hub ID (portal ID) | Page changes are reported with _hsq setPath + trackPageView (dev docs (external site)). HubSpot's automatic capture of non-HubSpot forms doesn't work on sites that change pages without reloading (KB (external site)). To tie leads to visits, add HubSpot as a form destination next to the email (Resend) when the assistant asks where form submissions go: the site's contact route then sends each submission to HubSpot as well, with the visitor's hubspotutk cookie once they've accepted analytics (docs (external site), checked 2026-12). It needs a HubSpot service key and, for marketing contacts, a HubSpot form with the same fields; setup in Forms, email and CRM. The email still arrives if HubSpot is down. Never install two HubSpot codes. |
| Plausible | The site's own script (Site settings > General > Site installation) | Since October 2025 each site has its own script (guide (external site)). Add goals named Lead and Contact Click in Plausible (docs (external site)). |
| Fathom | Site ID | Events use fathom.trackEvent (docs (external site)). |
| Matomo | Matomo URL and site ID | Decide with the client whether to run it cookieless (consent guide (external site)). |
| PostHog | Project token and host | Consider cookieless_mode (privacy docs (external site)). |
| Vercel Web Analytics | Nothing: turn it on in the Vercel project | Custom events need Pro (docs (external site)). |
After launch, check each tool's live or realtime view the same way as GA4 (see the checklist at the end).
Search Console and Bing (whatever you chose above)
Search Console shows which searches bring people
to the site, which pages Google has indexed and any problems it found. wp2next recommends it for every
site (tracking.searchConsole.google), plus Bing Webmaster Tools (tracking.searchConsole.bing).
Step-by-step: Google tracking setup.
Google Search Console
- Use a Domain property (
example.com, nothttps://www.example.com/), verified with a DNS TXT record at whoever manages the domain's DNS. It coverswwwand non-www,httpandhttps. Google says a new record can take 2–3 days to be seen. (docs (external site)) - If DNS is on Vercel:
vercel dns add example.com '@' TXT "google-site-verification=..."(docs (external site)). - Never delete that TXT record. Search Console re-checks it. Moving DNS to Vercel? Copy every existing record first, including TXT and email (MX) records (DNS cutover).
- After launch, submit
sitemap.xmlunder Sitemaps. - If you use GA4, link them (GA4 Admin > Product links > Search Console links) as a verified owner, then publish the "Search Console" report collection in GA4's Library. (docs (external site)) Plausible and Fathom have their own Search Console connections (links in the price table above).
Bing Webmaster Tools
Sign in at bing.com/webmasters, choose Import and connect Search Console. Your sites are verified and their sitemaps imported automatically. Data appears within about 48 hours. If you don't use Search Console, or later revoke Bing's access to it, verify the site with Bing directly (DNS or meta tag). (Bing announcement (external site))
Extra tags
migrate asks which extra tags you want. /wp2next tracking can re-ask later. These need GTM
(tracking.tagManager: "gtm"). wp2next always generates Google's own tags (GA4, Google Ads conversion,
remarketing, Conversion Linker) as proper built-in GTM tags.
Other vendors' tags are generated as Custom HTML tags, already set to wait for consent. They work,
but each vendor's official template is easier to maintain. docs/analytics/README.md lists the swap for
your setup. In GTM: Tags > New > Tag Configuration > Discover more tag types in the Community Template
Gallery, then search for the name below.
| Tag | ID you need | Template to search for |
|---|---|---|
| Meta (Facebook) Pixel | Pixel ID | "Facebook Pixel" (Meta now publishes an official one) |
| LinkedIn Insight Tag | Partner ID (Campaign Manager > Insight Tag) | "LinkedIn InsightTag 2.0" by linkedin |
| Microsoft Ads (UET) | UET tag ID | Not confirmed. If the gallery has a "Microsoft Advertising Universal Event Tracking" template from Microsoft, use it; otherwise keep the Custom HTML tag (checked 2026-12) |
| Microsoft Clarity | Project ID (from the Clarity project URL) | "Microsoft Clarity - Official", or connect GTM from Clarity's Settings > Setup |
| TikTok Pixel | Pixel ID | Use TikTok Events Manager's Google Tag Manager partner setup, or the "TikTok Pixel" template |
| Pinterest Tag | Tag ID | "Pinterest Tag" |
| Reddit Pixel | Pixel ID | "Reddit Pixel" (official, from Reddit) |
| X (Twitter) Pixel | Pixel ID, plus an event ID per conversion | "Twitter Base Pixel" and "Twitter Event Pixel" |
| Snap Pixel | Pixel ID | "Snap Pixel" |
| Hotjar | Site ID | "Hotjar Tracking Code" tag type, or Hotjar's own GTM connection |
| CallRail | Your company's script (Integrations > Google Tag Manager) | None; keep the Custom HTML tag |
| HubSpot | Hub ID | None; keep the Custom HTML tag. Never install two HubSpot codes |
Sources: LinkedIn (external site), Clarity (external site), TikTok (external site), Pinterest (external site), Reddit (external site), Hotjar (external site), CallRail (external site), HubSpot (external site). The publishers of the Meta, Microsoft Ads, TikTok, X and Snap gallery templates weren't confirmed (checked 2026-12). Check the publisher name in the gallery before installing.
Use one install route per vendor. If you connect a vendor through its own "GTM integration" button (Clarity, TikTok, Reddit, Hotjar), delete the matching Custom HTML tag. Two routes mean every event is counted twice.
Page views after the first page. A wp2next site changes pages without a full reload. GA4 counts those
page changes itself (enhanced measurement, above), and Microsoft's UET tag can too. Most other pixels
(Meta, LinkedIn, TikTok, Pinterest, Reddit, X, Snap, HubSpot) only see the first page of a visit unless
their page-view call also fires on route changes. Check in GTM Preview that each pixel fires again when
you click to a second page; docs/analytics/README.md notes which tags need this.
Call tracking (CallRail): the script swaps phone numbers on every page. Test it by clicking between pages, not only by loading one page, for the same reason.
Consent
Consent decides whether tags may set cookies before a visitor agrees. wp2next offers two setups
(tracking.consent in config). wp2next compliance checks
what actually fires before and after consent (Compliance: privacy, consent, accessibility and form checks).
US-only audience (us-only)
For sites that don't serve or advertise to the EU, UK or Switzerland. No cookie banner. The usual practice in US states with privacy laws, such as California:
- Publish a privacy policy that names the tracking tools the site actually uses.
- Provide a "Do Not Sell or Share My Personal Information" link (or "Your Privacy Choices") if the client runs ad pixels or retargeting, which can count as "sharing" under California law (general guidance, unverified for each state).
- Respect the browser's Global Privacy Control (GPC) signal.
Many US state laws only apply above a size threshold, which most small businesses don't reach. Whether they apply is a question for the client and their lawyer; the compliance report lists it under "needs your answers".
EU, UK or Swiss visitors (consent-mode-v2)
If the site serves or advertises to visitors in the EEA, UK or Switzerland, you need a consent banner (a CMP, "consent management platform") and, with Google tags, Google Consent Mode v2. Without it, Google stops measurement and remarketing for those visitors. (docs (external site))
- Pick a CMP (next section). wp2next never invents one.
- The site sets a "denied" consent default before GTM or any tag loads, then the CMP updates it when the visitor chooses.
- In GTM, turn on Admin > Container Settings > Enable consent overview.
- Google's tags already understand consent. The generated non-Google tags are pre-set to wait for the
right consent (for example, ad tags wait for
ad_storage). - Microsoft Ads has required consent signals for EEA, UK and Swiss traffic since May 5, 2025. (Microsoft (external site))
- Microsoft Clarity has enforced a consent signal for EEA, UK and Swiss visits since October 31, 2025; without it, Clarity runs without cookies. (Microsoft (external site))
Consent banners (CMPs)
migrate asks whether the site uses, or needs, a consent banner: keep the existing one, Termly,
CookieYes, Cookiebot, another product (Osano, iubenda, OneTrust, Usercentrics, Enzuzo), or none (US-only
audience). The answer is saved as tracking.cmp (provider, id, googleCertified, and
detectedFromWp when it was found on the old site).
Comparison (checked 2026-12)
Prices change often and aggregator sites disagree with vendors, so check the vendor's page before recommending one. "Certified" means the CMP is on Google's certified list (Google (external site)), which is required only for sites that show Google ads (AdSense, Ad Manager, AdMob) to EEA/UK/Swiss visitors. A site that only runs GA4 and Google Ads tracking needs Consent Mode v2 signals, not a certified CMP, but certified is a sensible default.
| CMP | Free tier | Paid from | Certified | GTM setup | Writes policies? | GPC |
|---|---|---|---|---|---|---|
| Termly | Yes: 10k banner views/month, basic policy and cookie policy, quarterly scans (pricing (external site)) | $10/month (annual) | Yes | "Termly Consent Management Platform" template; Termly recommends its script before GTM (Termly (external site)). Advanced Consent Mode needs Pro+ | Yes: privacy, cookie, terms | Unverified |
| CookieYes | Yes: 5k pageviews/month (pricing (external site)) | $10/month per domain | Yes | "CookieYes CMP" template (Google (external site)) | Cookie policy; privacy-policy generator (plans unverified) | Yes (features (external site)) |
| Cookiebot | Yes: 1 domain, under 50 subpages (pricing (external site)) | $8/month | Yes | Template listed by Google (exact name unverified), or its script before GTM | Cookie declaration only | Yes (functions (external site)) |
| Usercentrics | Self-serve free tier (limits unverified: sources say 1,000 or 1,500 sessions) | €7/month (pricing (external site)) | Yes | Template exists (name unverified) | No | Unverified |
| OneTrust | No | Quote only; reported floor around $10k/year (unverified) | Yes | Integration script with a Consent Mode toggle | Separate product | Yes |
| Osano | Yes: 1 domain, about 5k visitors/month | Plus around $199/month (unverified) | Yes | "Osano Consent Manager" template (Google (external site)) | Templates on Plus | Unverified |
| iubenda | Yes: under 5k pageviews/month, with branding (FAQ (external site)) | About $6/month (sources disagree) | Yes | "iubenda Privacy Controls and Cookie Solution" template (Google (external site)) | Yes: privacy, cookie, terms | Unverified |
| Enzuzo | Yes: 1 domain, about 5k visitors (pricing (external site)) | About $7–9/month (sources disagree) | Yes | Not on Google's integration list; script tag (unverified) | Basic privacy policy | Unverified |
Google's own list of CMPs with a Consent Mode integration: google.com, support.google.com, tagmanager, answer, 10718549 (external site). For a small business that also needs its policy pages written, Termly or iubenda cover both. For the cheapest banner with GPC support, CookieYes or Cookiebot.
Installing it
There are two ways, and wp2next sets up one of them:
- Script in the site's layout (recommended for Termly, Cookiebot and CookieYes). The banner and its blocking are in place before GTM loads, so nothing fires early.
- GTM template. One container controls everything. The CMP tag must use the Consent Initialization - All Pages trigger, which runs before every other tag. (Google (external site))
If you use both a script and a template, set the same defaults in both. Either way the order on the page is: consent default, then the CMP, then GTM.
Coming from a WordPress cookie plugin
wp2next looks for an existing banner in the WordPress copy (active plugins and the script hosts the page
loads) and records it as tracking.cmp.detectedFromWp.
-
A hosted CMP loaded by a plugin (Termly, CookieYes, Cookiebot, Usercentrics, OneTrust, Osano, iubenda): keep the same account. wp2next carries over its site ID (Termly website UUID, CookieYes website key, Cookiebot CBID and so on) and loads it on the new site. The plugin-to-ID mapping is based on known signatures and is unverified for each vendor; confirm the ID in the vendor's dashboard.
-
Complianz (and other WordPress-only banners such as Cookie Notice, GDPR Cookie Compliance, Real Cookie Banner and Borlabs; unverified for each) runs inside WordPress, so its banner, cookie scan, consent log and generated policy pages all disappear when the site leaves WordPress (Complianz on wp.org (external site)). Before cutover:
- copy the policy pages into Sanity as normal content (they're migrated with the other pages, but check they're complete),
- export the consent records if the client needs proof of consent,
- pick a hosted CMP to replace it (Termly, CookieYes or Cookiebot are the closest matches).
Returning visitors will see the banner again after launch, because the consent cookie changes. That's expected; tell the client beforehand.
Keeping search rankings through the move
- Same URLs: wp2next keeps WordPress's URLs, including trailing slashes. If every URL stays the same, Google treats the move as a hosting change. No special steps.
- Changed URLs: every old URL needs a permanent (301) redirect straight to its new URL. Use one hop, don't send everything to the homepage, and keep redirects for at least a year. (Google (external site))
- New domain: use Search Console's Change of Address tool as well. It's only for domain changes,
not for
httptohttpsorwwwchanges.
After launch: checklist
- Analytics is on:
NEXT_PUBLIC_DISABLE_ANALYTICSremoved in Vercel, and the GTM container published (if you use GTM) - The site is indexable:
robots.txtallows crawling and pages have nonoindex, except the private pages/brand/and/components/, which stay hidden from search engines on purpose - Titles, descriptions and structured data match the old site:
wp2next seo parityran before launch and had no open blocker - Your analytics tool's realtime or live view shows your visit (accept the banner first, if there is one)
- One real form submission shows one lead event (
generate_lead, or the tool's equivalent) - Phone and email clicks show up as events
- Each extra tag fires once in GTM Preview or the vendor's helper extension, including after clicking to a second page
- Google Ads shows each conversion action as "Recording conversions" within a day or two
- The consent banner appears for an EU visitor (if you use one), and no tracking cookies are set
before "Accept";
wp2next compliancechecks this - Search Console accepted the sitemap; spot-check key pages with URL Inspection
- Old URLs that changed return a single 301 to the right page
- Bing Webmaster Tools imported (or verified) the site
- Internal-traffic filter is set to Active once tested (GA4)
- Call-tracking numbers swap on every page, including after clicking between pages