---
title: Speculation Rules Make Your Site Instant and Quietly Break Your Analytics. Gate the Tags First.
description: The Speculation Rules API can prerender your next page for zero-latency navigation, but hidden pages fire your pixels and pageviews. Gate every tag on activation before you ship it.
author: LETSGROW Dev Team
date: 2026-10-14
category: SEO
tags: ["Speculation Rules", "Page Speed", "Core Web Vitals", "Analytics Tracking"]
url: "https://letsgrow.dev/blog/speculation-rules-prerender-marketing-analytics"
---
Instant page loads are no longer a performance team luxury. With the Speculation Rules API, a marketing site can prerender the next page while the visitor is still reading the current one, and the click feels instant. It is also the fastest way to corrupt your analytics if you flip it on without a plan. Turn it on, but gate your tags first.

## What Speculation Rules Actually Do

Speculation Rules is a small JSON block that tells Chromium browsers which URLs to fetch or fully render in the background. Prefetch downloads the document. Prerender goes further and loads the whole page, scripts included, in a hidden tab, then swaps it in on click.

For a landing page funnel, that is the difference between a navigation that takes a second and one that takes zero. Pricing page to demo form is the obvious case. Blog post to the next blog post is another.

::stat-block
- value: 0 ms
  label: Perceived navigation time when a prerendered page is activated on click
- value: 1 block
  label: Of JSON in a script tag is all it takes to start, no framework required
- value: Chromium
  label: Where it works today, so treat it as progressive enhancement and never a dependency
::

The rules are declarative, so there is no router rewrite. You list URLs or write a document rule that matches link patterns, then set an eagerness level. Moderate eagerness triggers on hover, which is the safe default for marketing pages. Eager fires immediately and should be reserved for one or two high-intent destinations.

## The Analytics Trap

Here is the part vendors skip. A prerendered page runs your JavaScript before the visitor has seen it. Your pageview fires, your pixels fire, your A/B test assigns a variant, and the visitor may never actually land there.

The results are predictable. Pageviews inflate on pages people hover but never open. Funnel steps look healthier than they are. Experiment arms get exposure counts that include people who never saw the variant. Ad platforms receive conversion events for pages nobody visited.

The fix is not to avoid prerendering. The fix is to make every tag wait for activation. The browser gives you the signals: `document.prerendering` is true while the page is hidden in the background, and a `prerenderingchange` event fires the moment the visitor actually navigates to it.

```js
function whenVisible(fn) {
  if (document.prerendering) {
    document.addEventListener('prerenderingchange', fn, { once: true });
  } else {
    fn();
  }
}

whenVisible(() => {
  // load GTM, fire pageview, assign experiment variant
});
```

Wrap your tag manager bootstrap in that function and everything downstream inherits the correct behavior. If you use Google Tag Manager, load the container inside the callback instead of inline in the head. Check your vendor tags too, because some handle prerender natively and many do not. Verify rather than assume.

## Scope the Rules So You Do Not Prerender Harm

Prerendering has side effects, and a careless rule list will find them. Never prerender URLs that change state: logout links, cart additions, unsubscribe endpoints, anything behind a GET that does work. Exclude pages that personalize heavily or that trigger a form prefill from a cookie. Exclude your consent banner flows, because a hidden page should not record consent on behalf of a person who has not seen it.

Use a document rule with an explicit allowlist and a deny list for patterns like `/api/`, `/logout`, and any URL carrying a campaign parameter you attribute on. Keep the number of speculative loads small. Chrome limits how many it will run at once, and every prerender costs bandwidth the visitor did not ask to spend.

::checklist
title: Speculation Rules rollout
items:
  - Tag manager and pixels load only after prerenderingchange when document.prerendering is true
  - Experiment assignment waits for activation, not for page load
  - State-changing URLs and API routes are excluded from every rule
  - Eagerness is moderate by default, eager only for one or two top destinations
  - Consent logic cannot fire from a prerendered page
  - Pageview counts are compared before and after rollout on the same pages
  - Rules ship behind a flag so you can turn them off in minutes
::

## Measure It Like an Experiment

Do not take the speed gain on faith, and do not take the analytics risk on faith either. Roll out to a slice of traffic or a handful of templates. Compare Largest Contentful Paint for navigations that were prerendered against those that were not, using field data and not a lab run. Then watch pageviews per session, bounce rate, and conversion rate on the affected pages for a week.

A healthy rollout shows faster loads, flat or slightly lower pageviews per session as phantom views disappear, and conversion rate that holds or improves. If pageviews jump up, your gating is broken. If conversions drop, you prerendered something that should have been excluded.

## The Takeaway

Speculation Rules is one of the cheapest performance wins available to a marketing site, and one of the easiest to get wrong. Gate every tag on activation, exclude anything that changes state, start with hover-triggered prerendering on your highest-traffic funnel steps, and measure before you expand. Do that and you get instant navigation with clean data. Skip the gating and you get a fast site that lies to you.
