web_scan_tags
Web pages read low risk
Part of the Tracking Audit Agent.
What it does
Scan one landing page for its tracking tags: what a tracking specialist checks by hand in the browser. Sources: the request URLs of Google's PageSpeed page load (the same server-side job and 15-minute cache as web_get_pagespeed_report, mobile, so a page the CRO report already analysed costs nothing) and the page's raw HTML, read by Scalix (ids written inline, hidden form fields). Finds: Google Tag Manager containers (gtm.js on any host, so a server-side container on the site's own domain counts), the Google tag (GT-, DC-), GA4 measurement ids (gtag.js, /g/collect), Google Ads ids (AW-, conversion pings), the LinkedIn Insight Tag partner id, the Meta pixel id, the HubSpot tracking code's portal id (EU portals and HubSpot-hosted pages included), Microsoft Clarity and Hotjar; consent tools (Cookiebot, OneTrust, Usercentrics, CookieYes, Termly, iubenda, Didomi, Osano, Complianz, consentmanager, HubSpot cookie banner, TrustArc, CookieFirst, Cookie Script, CookieHub, Axeptio, Borlabs Cookie, Real Cookie Banner, Finsweet Cookie Consent) and Google's consent signals (gcs and gcd: the raw values plus a best-effort decoding of ad_storage, analytics_storage, ad_user_data and ad_personalization); booking tools (Calendly, HubSpot Meetings, Chili Piper, SavvyCal, Cal.com); form tools (HubSpot, Typeform, Marketo, Pardot, Jotform, Tally); hidden inputs whose name contains gclid, gbraid, wbraid or utm_ (form_fields[gclid] included); and personal data in request URLs (only parameters named email, e-mail or mail whose value holds an @, or phone or tel whose value is a phone number (GA4's ep./up. prefixes included), reported by host and parameter name, never the value). Each id says how many requests carried it, their hosts and whether the HTML names it. A GTM container also says how many times the HTML installs its snippet (snippets; comments, JSON and Next.js page data not counted). Judgements are check rows {item, status: pass | problem | suspected | not_verified | info, found, expected, evidence, fix, owner, priority}: Google tag on the page, GTM installed once (the same container loaded twice, or its snippet twice in the HTML, is a problem; two different containers loading is suspected: check they do not fire the same tags), GA4 tag, tags in the HTML that did not load, Consent Mode v2 signals, HubSpot tracking code, personal data in request URLs, click-id and UTM hidden fields, and a Google Ads conversion fired on a plain page load (suspected: unless the page is the thank-you page, every visit counts as a conversion). LIMITS: one page load from the US, no clicks, no form submit, the consent banner unanswered; the HTML read is https only, same-site redirects, 5 MiB, and its failure is a warning, not an error. Never returns request URLs or the HTML. Read-only; stores nothing. Returns {success, data:{url, final_url, seen, gtm, google_tag, ga4, google_ads, linkedin, meta, hubspot, behaviour_tools, consent:{tools, signals:{google_requests, gcs, gcd}}, booking_tools, form_tools, hidden_fields, personal_data_in_urls, conversions_on_load, requests_seen, html_read, checks, check_counts}, warnings}.
When to use it
Use in every tracking audit to see which tracking tags a landing page loads (GTM, GA4, Google Ads, LinkedIn, Meta, HubSpot), its consent tool and signals, its booking and form tools and its click-id capture, and whenever the user asks whether a page has a tag, a consent banner or a duplicate GTM container.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
url | string | yes | Full landing page URL exactly as a visitor opens it (https://...). Public pages only; one page per call — scan the top 1-3 landing pages. |
Safeguards
Policy
Read-only; public pages only; stores nothing. Report ids, hosts, tool names and parameter names only: never a request URL, the HTML or a personal-data value. Keep suspected and not_verified exactly as returned, with their reason: a tag not seen in one page load is never reported as missing.
Reminder
Google loads the page once from the US with no clicks and the consent banner unanswered, so consent-gated, delayed and click-triggered tags do not show. Settle 'not seen' with GA4's hostnames before calling anything a problem, and scan the top 1-3 landing pages, not just one.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
invalid_argument | url is not a full http(s):// page URL, or PageSpeed Insights could not analyse it. | Pass the public landing page URL exactly as a visitor opens it. A page behind a login or bot protection cannot be scanned: write its tag checks NOT VERIFIED with the message. | no |
in_progress | Google is still analysing the page (Lighthouse takes 15-120 s, up to about five minutes when its first run fails and Scalix retries it; one tool call waits 45 s). | Call web_scan_tags again with the same url in about 20 s — the analysis keeps running on the server and its answer is kept 15 minutes. Never write NOT VERIFIED because of in_progress. | yes |
rate_limited | PageSpeed Insights refused the request (quota). | If the server has neither a Google identity (ADC) nor SCALIX_PAGESPEED_API_KEY it used the anonymous quota, which is shared with the whole internet and usually exhausted — give it one; otherwise wait a minute and retry, and raise the PageSpeed Insights quota on the Scalix project if it persists. | yes |
not_configured | PageSpeed Insights rejected the credential (API key, the server's Google identity, or an anonymous request). | Enable the PageSpeed Insights API (pagespeedonline.googleapis.com) on the Scalix project and grant the server identity serviceusage.serviceUsageConsumer (locally: gcloud auth application-default set-quota-project); with a key, check SCALIX_PAGESPEED_API_KEY. The error names the project. | no |
platform_unavailable | Google's analysis failed: twice in a row with a server error (Scalix retried it once automatically; the message quotes Lighthouse's reason, e.g. PAGE_HUNG), no answer within its 150 s ceiling, or the API was unreachable. | After the double server error (is_retryable false), do not call again: write this page's tag checks NOT VERIFIED with the message, or scan another landing page. After a timeout or an unreachable API (is_retryable true), call once more. | yes |
not_available | Google's page load listed no network requests, so the page's tags cannot be judged. | Write this page's tag checks NOT VERIFIED with the message, or scan another landing page; Google's answer is kept 15 minutes, so calling again at once returns the same. | no |
Edge cases
- The HTML read failing (bot protection, a redirect to another site, an http:// page, over 5 MiB) is a warning, not an error: html_read is false, ids written only in the HTML and hidden fields are not checked, and the hidden-fields row is not_verified.
- Server-side GTM: gtm.js served from the site's own subdomain is reported with that host. A renamed custom loader (no gtm.js?id=, no /g/collect) is not recognised; GA4's hostnames settle whether the page is tagged.
- An id the HTML names that never loads (a speed plugin delaying JavaScript, a consent wait, a custom loader) is not_verified, never a problem; with a consent tool on the page, a Google tag or GA4 not seen is not_verified too.
- Consent tools often set defaults only for EEA/UK visitors and Google loads the page from the US, so Consent Mode v2 signals 'not set' with a consent tool present are not_verified; with no consent tool at all they are a problem.
- gcs and gcd are decoded from community documentation (Google publishes neither format): the raw values come with the labels, and a letter outside the known set reads 'unreadable'.
- Forms rendered by script (HubSpot, Typeform, Marketo) add their hidden fields after load, so they are not in the HTML; the CRM's click-id and UTM fill rates settle capture.
- One page load is not every visit: a thank-you page after a form submit is not covered, so personal data sent there is not seen.
- Two GTM containers can be intended (one per team or vendor): the problem row asks to remove the extra snippet or confirm both are meant to be there and do not fire the same tags.