go-find-out
docs

Google tag or HubSpot tracking code loads but sets no cookie

When a Google tag or the HubSpot tracking code downloads but leaves no cookie, the script arrived and did not record the visit. Causes that leave this evidence include a consent banner holding cookies until the visitor accepts, a Tag Manager tag that never fires on the page, and a Content Security Policy blocking part of the tag.

The finding on the scan

The scan shows it as:

Your tag loaded but never captured

www.googletagmanager.com returned 200 · no tracking cookie 2.5s after load

Google Ads may not show the problem. The Tracking status column under Goals, Conversions, Summary (Google Ads Help) can show the tag as active while this page stored nothing, because Google reports whether it has seen the tag, and in advanced consent mode a tag with consent denied still loads and sends cookieless pings.

The scan loads your page once in an ordinary headless browser, clicks nothing (including any consent banner), adds no click ID (gclid, gbraid or wbraid) to the URL, and reads the cookies 2.5 seconds after the page’s load event. A Google tag counts as loaded when www.googletagmanager.com or ad.doubleclick.net answered, and as captured when any of _ga, _gid, _gcl_au or _gcl_dc, or a cookie starting _ga_ or _gat_, was set. _gcl_aw is never required, because it stores a click ID and the scan sends none. The HubSpot tracking code counts as loaded when js.hs-scripts.com, js.hscollectedforms.net or track.hubspot.com answered, and as captured when hubspotutk or __hstc was set.

If the evidence line lists cookies instead of “no tracking cookie”, one of the two tags captured and the other did not. Check the one whose cookies are missing from the list.

Confirm it on your own setup

  1. Open the page in a private window so earlier consent choices and cookies do not carry over, and do not touch the consent banner yet.
  2. Open the browser’s developer tools, go to Application, then Cookies, and select your domain. Look for the cookies named above. HubSpot’s own tracking code troubleshooting article walks through the Network tab check for the HubSpot script.
  3. Open the Console tab and look for errors, Content Security Policy violations, or messages from a consent tool.
  4. For the Google tag, start a session in Tag Assistant to see which tags loaded and what they sent.
  5. Accept the consent banner, reload, and check the cookies again. If they appear now, read the consent section below first.

This can be expected behaviour. If your banner requires opt-in, the scan sees the page as a visitor who has not answered yet, and for a visitor who accepts the tag may work as intended. Google’s consent mode overview says that with ad_storage denied no new advertising cookies may be written, and with analytics_storage denied no analytics cookies are read or written. HubSpot’s banner types article says an opt-in banner keeps HubSpot cookies off the browser until the visitor consents. Whether to keep that setup is a privacy and legal decision. The steps below only check that consent, once given, reaches the tags.

  1. In Tag Assistant, follow Google’s consent debugging guide: select the earliest Consent event to see the default state, then accept the banner and check that the most recent Consent event shows the four consent types updated.
  2. If you use Tag Manager, enable and open the Consent Overview and check the Additional Consent Checks setting on the Google tag.
  3. For the HubSpot banner, open the banner’s settings as described in Set up cookie tracking settings and consent banners and confirm its type is the one you intended.
  4. If a third-party consent tool manages HubSpot cookies, HubSpot’s consent banner FAQ says this needs the Cookiebot integration or a custom setup through the consent banner API. Check that setup passes the visitor’s acceptance on.

The Google tag in your Tag Manager container does not fire on this page

www.googletagmanager.com serves Tag Manager containers as well as the Google tag, so a container that loads while its Google tag never fires gives the same evidence.

  1. Open your container and start Preview mode, enter the page URL, and connect.
  2. On the first page view, check whether the Google tag is listed under tags that fired, and which trigger kept it from firing if not.
  3. Fix the trigger, check the tag again in Preview, and publish the container.

If the HubSpot tracking code is installed through Tag Manager, HubSpot’s installation article gives the Custom HTML tag steps and recommends the All Pages trigger.

The page’s Content Security Policy blocks part of the tag

A CSP can allow the script file and still block what it needs to run or send. The Console names the blocked resource.

  1. Copy the blocked URL or inline script from the Console message.
  2. For the Google tag, compare your policy with the directives in Google’s Tag Manager and CSP guide, which lists the hosts for Google Ads and a nonce for the container snippet.
  3. For HubSpot, the troubleshooting article above names CSP restrictions as a blocker, but HubSpot’s Knowledge Base has no page listing the domains to allow. Use the hosts the Network tab shows the tracking code requesting.

Blockers in visitors’ browsers

Some visitors run browsers or extensions that block tracking scripts before any request leaves. That is nobody’s fault, nothing on your site recovers it, and the scan cannot see it, because it uses its own browser.

Check it again

Scan the page again after the change to see whether the finding is still there.

Free, no account. Shows whether the finding is still there.