Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Dynamic text replacement showing raw tokens: how to fix it

CNV-352Medium impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

Dynamic text replacement swaps a placeholder (a token) in your page for a real value. The value may come from a URL parameter such as ?kw=plumber, a cookie, an ad platform, a CRM or a personalisation tool. A headline like Best {{keyword}} in {{city}} should become Best plumber in Leeds.

Why it costs you leads or sales

A headline with curly brackets in it tells visitors the page is unfinished or careless. Trust drops right where you want a click or a form fill. It often hits paid traffic hardest, because those landing pages depend on URL parameters that can be lost.

Common causes:

Common causes of raw tokens and where to look
CauseWhat you seeWhere to look
Parameter missing from the URLToken shows only on some visitsAd final URL, tracking template
Redirect strips the query stringToken shows after a redirectRedirect rules, link shorteners
Script blocked, slow or failedToken flashes or staysBrowser console, consent banner
No fallback value setToken shows when data is emptyTool or theme settings
Token typed in wrong formatToken shows on every visitPage editor, tool docs
Page cached with the tokenToken shows for many peopleCache or CDN settings
How a token ends up on screen
  1. Ad clickLink has or lacks the parameter
  2. Redirect or cacheQuery string dropped
  3. Replacement scriptFinds no value, no fallback
  4. Visitor sees {{keyword}}Trust drops, they leave

The break happens when the value never reaches the page.

How to check if your site has it

Find unreplaced tokens
  1. Open the page with no parameters

    Load the bare URL in a private window. If a token shows, your fallback is missing.

  2. Open it with the real ad URL

    Copy the final URL from your ad, including all parameters, and load it. Compare the text.

  3. Search the page for brackets

    Press Ctrl+F (Cmd+F on Mac) and search for {{, [, %% and {keyword. Also view source and search the same strings.

  4. Check the address bar after loading

    If the parameters vanished, a redirect is stripping them.

  5. Try with consent declined and on mobile

    Some tools wait for consent or load late on slow connections.

How to fix it

First decide which cause applies, then set a fallback in every case. A fallback is the default words shown when no value is available, such as local experts instead of {{keyword}}.

Fix by platform
  1. Check the plugin or shortcode

    If a plugin or shortcode fills the text, confirm it is active and the shortcode name matches exactly. A deactivated plugin leaves the shortcode text visible.

  2. Set a default

    Most dynamic text plugins have a default or fallback field. Fill it in for every token.

  3. Exclude the page from caching

    Clear the cache and, if the value comes from the URL, make sure your caching plugin varies by query string or fills it in the browser.

The safest pattern is to write the default text directly in the HTML, and let a script overwrite it only when a value exists. Then a failed script leaves clean copy, not a token.

Default text in HTML, replaced only when a value existshtml
<h1>Best <span data-dyn="kw">local experts</span> near you</h1>
<script>
  var kw = new URLSearchParams(location.search).get('kw');
  if (kw) {
    document.querySelectorAll('[data-dyn="kw"]').forEach(function (el) {
      el.textContent = kw;
    });
  }
</script>
Apache redirect that keeps the query stringhtaccess
RewriteEngine On
RewriteRule ^old-page/?$ /new-page/ [R=301,L]
# Apache keeps the query string by default.
# Add QSD only if you want to drop it. Do not add it here.
Headline with and without a fallback

Before

  • Headline reads Best {{keyword}} in {{city}}
  • Shows whenever the parameter is missing
  • Visitor assumes the page is broken

After

  • Headline reads Best local experts near you
  • Real keyword replaces it when present
  • Page always reads cleanly

How to confirm it's fixed

Confirmation checks
  • Bare URL shows clean fallback text
  • Full ad URL shows the personalised text
  • A URL with an empty value (for example ?kw=) shows the fallback
  • No {{, [ or %% appears in the page or in view-source
  • Works with consent declined, on mobile and in a private window
  • Redirected links still show the right text

How to prevent it happening again

Tokens usually break after changes: a new ad URL, a new redirect, a theme update or a tool swap. Build a few habits around that.

Prevention habits
  • Require a fallback for every token before a page goes live
  • Test each new ad final URL before launching the campaign
  • Retest after redirect, cache, plugin or consent banner changes
  • Keep one list of tokens and where their values come from
  • Prefer default text in the HTML over relying on a script
How it often unfolds (example)
  1. Day 1

    New campaign launches with a tracking template that drops the keyword parameter.

  2. Day 2

    Landing page headline shows {{keyword}} to paid visitors.

  3. Day 5

    Someone notices the lower lead count.

  4. Day 5

    Fallback added and URL fixed. Headline reads cleanly.

How FunnelGuard handles this

FunnelGuard detects this today. A robot visitor loads your page on a schedule, from the EU or the US, and runs a text check (text_absent) that looks for text that should not be on the page, such as {{ or other token patterns you choose. If the token text is found, the step fails.

A failure is re-checked from a second region before one alert goes out, by email, Slack, Teams, WhatsApp, webhook or PagerDuty, with a screenshot and a likely cause. The check only sees what the robot sees, so a token that appears only with a specific parameter needs that URL in the journey. The Free plan covers 1 site and 2 journeys with daily checks and no card, and paid plans have a 3-day free trial.

Questions people ask

Why is my landing page showing {{keyword}} instead of the real text?

The page expected a value, usually from a URL parameter or a script, and did not get one. Common reasons are a missing parameter in the ad URL, a redirect that drops the query string, or a script that failed. Add a fallback and fix the source of the value.

How do I add a fallback to dynamic text?

Write the default words directly in the page HTML and let a script replace them only when a value exists. In tools, fill the default or fallback field for each token. In Google Tag Manager, set a default value on the variable.

Why does the token only show for some visitors?

Only some visits lack the value. Examples are visitors arriving without the parameter, visitors whose consent choice blocks the script, or a cached page served before the replacement ran. Test with and without parameters and with consent declined.

Can a redirect cause raw tokens to appear?

Yes. If a redirect drops the query string, the parameter that fed the text is gone by the time the page loads. Check the address bar after loading and change the redirect to pass the query string through.

How do I find unreplaced tokens across my site?

Search each page and its view-source for patterns like {{, [ and %%. For regular coverage, a monitor can load key pages on a schedule and fail when that text appears.

Does FunnelGuard detect raw tokens on a page?

Yes. It runs a text check that fails if unwanted text, such as a token pattern, is present on the page. It re-checks from a second region before alerting you with a screenshot.

Is it safe to put URL values into my page text?

Only if you insert them as plain text, for example with textContent, and never as HTML. Inserting raw URL values as HTML can let someone craft a link that injects code.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: text_absent.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.