Skip to content
wp2next, home
Skip to the page

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 , Tag Manager and Search Console, see Google tracking setup.

During migrate, wp2next asks three questions about measurement and suggests an answer for each:

  1. Which analytics tool? It suggests the Google stack: Google Analytics 4 (GA4) loaded through (GTM). You can pick something else, or nothing.
  2. Do you need a ? If the site has one already, wp2next finds it in the WordPress copy and suggests keeping it.
  3. ? 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

StackPick it whenMain 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 onlyHubSpot 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 FathomMost 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.
MatomoThe client wants GA4-level depth but owns the data, or must self-host.More setup; some features are paid add-ons when self-hosted.
PostHogThe client also wants funnels, session replay and product analytics in one tool.More than a small brochure site usually needs.
Vercel Web AnalyticsYou 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.
NoneThe client explicitly doesn't want analytics.Search Console still works and is still recommended.

Why the Google stack is the default. GA4's 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 '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 . 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)

ToolFree optionPaid fromCookielessSearch Console data inside the tool
GA4Free—NoYes, via the GSC link
HubSpotFree 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 unverifiedMarketing Hub Starter for Ads syncNo (__hstc, hubspotutk and others; cookies⁠ (external site))Unverified
Plausible30-day trial; self-hosted Community Edition (free, unverified on the pricing page)$9/month for 10k pageviews (pricing⁠ (external site))YesYes (docs⁠ (external site))
Fathom7-day trial (card needed)$15/month for 100k pageviews (pricing⁠ (external site))YesYes, every plan
MatomoSelf-hosted On-Premise is freeCloud from €29/month for 50k hits (pricing⁠ (external site))Optional (disableCookies)Paid add-on self-hosted; included in Cloud
PostHog1M events and 5k replays a month (pricing⁠ (external site))Usage-basedOptional (cookieless_mode)Unverified
Vercel Web AnalyticsHobby: 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 tracking writes 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 . 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_lead when 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 in tracking.leadParams).
  • contact_click when someone taps a phone number or email link, with method (phone or email), contact_value (the number or address) and link_location (header, footer or body). There is one event for both: to count only phone taps, filter or build a key event on method = phone.
  • virtual_page_view when 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 (or migrate) 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.json under tracking: analytics, tagManager, searchConsole (google, bing), cmp, consent and the extra tags. Change them and run /wp2next tracking again.
  • 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 .

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: (Admin > Property access management), HubSpot portal, Plausible or Fathom site, and so on
  • Admin or Publish access to their existing , 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
  • 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 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, 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 , 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_lead itself, only on success); Page changes based on browser history events on.
  • Key events: generate_lead, plus contact_click (or a phone-only phone_click derived from it) if the client counts calls and emails as leads. Register method, link_location and 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

  1. Create a Web container in the client's GTM account, or use the existing one. Note the container ID (GTM-…).
  2. Run /wp2next tracking (or let migrate do it). It asks for any IDs it doesn't have yet and generates docs/analytics/gtm-container.json.
  3. Import it: Admin > Import Container > Merge > Rename conflicting tags, triggers, and variables. Overwrite only on a new, empty container. (setup)
  4. 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)

  1. 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.
  2. 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))
  3. Link GA4 and Google Ads, with auto-tagging (setup).
  4. Count each lead once. Either the Ads conversion tag or the imported GA4 key event is the "primary" conversion for bidding, not both.
  5. 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 5.

ToolWhat wp2next needsNotes
HubSpotHub 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.
PlausibleThe 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)).
FathomSite IDEvents use fathom.trackEvent (docs⁠ (external site)).
MatomoMatomo URL and site IDDecide with the client whether to run it cookieless (consent guide⁠ (external site)).
PostHogProject token and hostConsider cookieless_mode (privacy docs⁠ (external site)).
Vercel Web AnalyticsNothing: turn it on in the Vercel projectCustom 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 (tracking.searchConsole.bing). Step-by-step: Google tracking setup.

Google Search Console

  • Use a (example.com, not https://www.example.com/), verified with a DNS TXT record at whoever manages the domain's DNS. It covers www and non-www, http and https. 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 . 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.xml under .
  • 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.

TagID you needTemplate to search for
Meta (Facebook) PixelPixel ID"Facebook Pixel" (Meta now publishes an official one)
LinkedIn Insight TagPartner ID (Campaign Manager > Insight Tag)"LinkedIn InsightTag 2.0" by linkedin
Microsoft Ads (UET)UET tag IDNot 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 ClarityProject ID (from the Clarity project URL)"Microsoft Clarity - Official", or connect GTM from Clarity's Settings > Setup
TikTok PixelPixel IDUse TikTok Events Manager's Google Tag Manager partner setup, or the "TikTok Pixel" template
Pinterest TagTag ID"Pinterest Tag"
Reddit PixelPixel ID"Reddit Pixel" (official, from Reddit)
X (Twitter) PixelPixel ID, plus an event ID per conversion"Twitter Base Pixel" and "Twitter Event Pixel"
Snap PixelPixel ID"Snap Pixel"
HotjarSite ID"Hotjar Tracking Code" tag type, or Hotjar's own GTM connection
CallRailYour company's script (Integrations > Google Tag Manager)None; keep the Custom HTML tag
HubSpotHub IDNone; 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 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 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 (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 report lists it under "needs your answers".

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))

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.

CMPFree tierPaid fromCertifiedGTM setupWrites policies?GPC
TermlyYes: 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, termsUnverified
CookieYesYes: 5k pageviews/month (pricing⁠ (external site))$10/month per domainYes"CookieYes CMP" template (Google⁠ (external site))Cookie policy; privacy-policy generator (plans unverified)Yes (features⁠ (external site))
CookiebotYes: 1 domain, under 50 subpages (pricing⁠ (external site))$8/monthYesTemplate listed by Google (exact name unverified), or its script before GTMCookie declaration onlyYes (functions⁠ (external site))
UsercentricsSelf-serve free tier (limits unverified: sources say 1,000 or 1,500 sessions)€7/month (pricing⁠ (external site))YesTemplate exists (name unverified)NoUnverified
OneTrustNoQuote only; reported floor around $10k/year (unverified)YesIntegration script with a Consent Mode toggleSeparate productYes
OsanoYes: 1 domain, about 5k visitors/monthPlus around $199/month (unverified)Yes"Osano Consent Manager" template (Google⁠ (external site))Templates on PlusUnverified
iubendaYes: 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, termsUnverified
EnzuzoYes: 1 domain, about 5k visitors (pricing⁠ (external site))About $7–9/month (sources disagree)YesNot on Google's integration list; script tag (unverified)Basic privacy policyUnverified

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.

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 () 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 http to https or www changes.

After launch: checklist

  • Analytics is on: NEXT_PUBLIC_DISABLE_ANALYTICS removed in Vercel, and the GTM container published (if you use GTM)
  • The site is indexable: robots.txt allows crawling and pages have no noindex, except the private pages /brand/ and /components/, which stay hidden from search engines on purpose
  • Titles, descriptions and match the old site: wp2next seo parity ran 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 compliance checks 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