Skip to main content

My Experience isn't showing on the right page

Learn how to diagnose and fix URL or Element matching issues in Chameleon so your Experiences show up on the right pages.

Written by Amanda Oliveira
Updated today

If you're on the page where an Experience should appear but nothing shows up, there are two likely causes: the URL rule isn't matching the current page, or the element the Step is anchored to isn't found. This article covers how to diagnose and fix both.


Start here: run the Debugger

chmln.debug("YOUR_EXPERIENCE_ID")

Check the output for two messages:

  • URL not Matching

  • Element not found

πŸ’‘ Tip: You can paste the output from the debugger in Chameleon's Copilot and it'll walk you through the issue!


URL matching issues

Each Step in a Chameleon Experience can have a URL rule that controls which page it appears on. This is something you can set up when creating your Experience.

If the rule does not match the current page, the Step will not display β€” even if the snippet is installed, the user is identified, and the audience matches. URL mismatches are one of the most common causes of Experiences not showing.

How URL rules work

URL rules are evaluated against the full URL of the current page, including the path, query parameters, and hash fragment. Chameleon supports four rule types:

Rule type

How it works

Example

URL contains

Experience will show on all pages whose URL contains the input string.

Input: /dashboard β†’ shows on app.example.com/dashboard?tab=overview

URL is exactly

Experience will only show on pages whose URL matches the input string exactly.

Input: app.example.com/settings β†’ only shows on that exact URL, not app.example.com/settings?tab=billing

URL matches regex

Experience will show on pages whose URL matches the regular expression defined in the input field.

Input: /projects/[0-9]+/overview β†’ shows on app.example.com/projects/12345/overview

URL does not contain

Experience will show on pages whose URL does not contain any of the input string.

Input: /admin β†’ shows on all pages except those with /admin in the URL

URL is not exactly

Experience will show on all pages whose URL does not match the input string exactly.

Input: app.example.com/home β†’ shows everywhere except that exact URL

How to check if a URL rule is failing

Run the Debugger with your Experience ID in the browser console:

chmln.debug("YOUR_EXPERIENCE_ID")

The output will let you know if the URL rules do not apply to the current page.

You can also check on the Builder. Open the Tour in the Builder for the URL you want to check, and look at the top-right corner. A message will appear if the URL rule for the step you're viewing doesn't match the URL:

Common URL matching mistakes

Query parameters not accounted for

If your page URL contains query parameters like ?onboarding=true, an Exact rule that does not include the full query string will fail. Switch to Contains if the parameter changes.

Hash fragment in URL

A URL like /settings#billing will not match a rule for /settings when using Exact match. Use Contains or add an explicit rule that includes the hash.

Subdomain not included

A rule for app.example.com/dashboard will not match staging.example.com/dashboard. Each subdomain must be covered by its own rule, or use a Contains rule for the path only.

Dynamic path segments

URLs that include variable IDs (e.g. /projects/12345/overview) will not match a static rule like /projects/overview. Use a Contains rule for a stable part of the path (/projects/) or a Regex rule to match the pattern.

Wrong rule applied to a multi-step Experience

URL rules can be set per Step. If Step 1 matches but Step 2 has a stricter rule, the Experience will start but then stall. Check each Step's URL rule individually in the Builder.

URL matching in single-page applications

In SPAs, the URL changes via the browser's History API without a full page reload. Chameleon polls for URL changes regularly and will re-evaluate URL rules when the URL updates. However:

  • If your SPA uses hash-based routing (e.g. /#/dashboard), write your URL rules to match the hash fragment explicitly, or use a Contains rule for the route name.

  • If your SPA uses query-parameter-based routing (e.g. ?view=dashboard), use a Contains rule rather than Exact.

How to fix a URL matching issue

  1. Open the Experience in the Builder and navigate to the Step that is not showing.

  2. Click the Step to open its settings, then find the URL field.

  3. Compare the rule to the actual URL in your browser's address bar.

  4. Update the rule type and value to match. Use Contains for most cases.

  5. Click Apply Changes to publish the update.

  6. Reload the page and run chmln.debug("YOUR_EXPERIENCE_ID") to confirm the URL now matches.


Element Issues

When a Chameleon Step is configured to attach to a specific element on the page β€” either as a trigger, as an anchor or as an Element Rule β€” that element must be present and accessible when the Experience tries to display. If it is not found, the Step waits indefinitely and nothing shows. This article covers how to diagnose and fix element-related display issues.

How elements are used in Experiences

Chameleon uses page elements in two ways:

Type

What it does

Trigger element

An Experience is set to appear only when the user clicks or hovers over a specific element. If that element is not on the page, the trigger can never fire.

Anchor element

An Experience tooltip or spotlight is positioned relative to a specific element. If the element is not found, the Experience cannot be placed and will not display.

Element Rule

An Experience is set to appear only when a specific element is present or absent on the page. If that element is not on the page, the trigger can never fire.

Both types use CSS selectors to identify elements.

How to check if an element issue is causing the problem

Run the Debugger in your browser console:

chmln.debug("YOUR_EXPERIENCE_ID")

If the output mentions "element not found" or the Step appears to be waiting with no error about URL or audience, the element is likely the cause.

You can also inspect the page manually: right-click where the element should be and select Inspect. If it is not in the DOM, Chameleon will not find it.

Common element issues

The element has not loaded yet

Some elements load after the initial page render; inside a modal, after an API call completes, or via lazy loading. If Chameleon checks for the element before it exists in the DOM, the Step waits.

Fix: If the element eventually appears, Chameleon will detect it and display the Step once it does. If the element never appears on initial load, consider removing the element requirement or using a URL rule to restrict the Step to the page where the element always exists.

The element selector is too specific

When the Builder records a CSS selector, it captures the exact path to the element at that moment. If your application generates dynamic class names, IDs, or deeply nested structures that change between sessions, the stored selector may no longer match.

Fix: Open the Step in the Builder, click the element selector, and use the selector editor to simplify or broaden it. Prefer stable attributes like a data-testid, a unique class, or a readable element ID over auto-generated values.

The element exists but is visually hidden

An element with display: none is present in the DOM but not visible. Depending on the Experience type, Chameleon may not treat this as a valid anchor.

Fix: Check the element's computed styles in browser DevTools. If the element has display: none adjust your URL rule or display conditions so the Step only attempts to show when the element is visible.

Positioning issues (z-index and layering)

If the Experience is showing but appearing behind other page elements β€” menus, modals, fixed headers β€” the issue is CSS stacking context, not element detection. Chameleon Experiences have a default z-index, but your application's CSS may render certain elements on top of them.

Fix: Read Using CSS layering to adjust where your Experience shows up for how to use custom CSS to adjust the z-index of Chameleon Experiences.

Still stuck?

Did this answer your question?