Pages & URL targeting
Not every test should run on every page. In everyday language, Pages means “these URLs, not those.” In CROForge, the Pages configuration tab is URL targeting: a list of Include rules and Exclude rules. Smart Code compares the visitor’s current address (typically origin plus pathname) against those rules. The experiment may run only when at least one Include matches and no Exclude matches. Getting this wrong is the usual reason a test “never fires” or fires on the blog, checkout, and homepage at once.
Words used on this page
| Word | Everyday meaning | Meaning in CROForge |
|---|---|---|
| Pages | The web pages where something should happen. | The Configuration sub-tab that stores URL include and exclude rules for this campaign. |
| URL targeting | Choosing which addresses are in scope. | The rule engine Smart Code uses after the domain allowlist and before the audience segment. |
| Include | “This is allowed.” | At least one Include rule must match the current page or the experiment is skipped. |
| Exclude | “This is not allowed.” | If any Exclude rule matches, the experiment does not run, even if an Include also matched. |
| Match type | How two pieces of text are compared (exact, contains, starts with, and so on). | The operator on each URL rule (Exact, Contains, Starts with, Regex, and related operators). Prefer Exact or Starts with over Regex when you can. |
| Validator | A checker that tells you if a sample would pass. | Paste sample URLs and see whether they would be targeted before you launch. |
| Origin | The site identity: scheme plus host, for example https://example.com. | Part of the cleaned URL Smart Code compares (with pathname). Query strings and hashes are often stripped. |
| Pathname | The path after the domain, for example /pricing. | The other half of the runtime comparison. Trailing slashes are typically normalized. |
Screenshots
Filename: url-targeting-editor.png (Pages tab with include/exclude rules and match types). Place the file under docs/assets/placeholders/.
Filename: url-validator.png (sample URL checker). Place the file under docs/assets/placeholders/. Paste both screenshots into WordPress after you copy this article; do not add image tags here.
How include and exclude work together
Write two lists, then read them as a single sentence: “Run if the page is on the include list, unless it is also on the exclude list.”
runs = includeMatch && !excludeMatch
- Include must match — if nothing in Include matches the current page, the experiment is skipped.
- Exclude must not match — if any Exclude matches, the experiment is skipped even when Include passed.
This is the second gate in runtime evaluation: domain allowlist → URL targeting → segment → variation assignment.
What each rule contains
| Field | Everyday meaning | How CROForge uses it |
|---|---|---|
| Match type | The comparison style. | Exact, Contains, Starts with, Regex, and related operators from the conditions system. |
| URL pattern | The text you are matching against. | Usually written as origin plus path, matching the cleaned form Smart Code actually sees. |
| Include / Exclude | Which list the rule belongs to. | Include allows; Exclude blocks. Both are evaluated on every eligible page load. |
How to set Pages
- Open the campaign → Configuration → Pages.
- Add at least one Include rule for the page or section you intend to test.
- Add Exclude rules for look-alike URLs that should stay out (blog, enterprise pricing, app subpaths).
- Paste real sample URLs into the validator and confirm each would be in or out as you expect.
- Save, then continue to Variations.
Client examples
| Goal | Include | Exclude |
|---|---|---|
| Entire marketing site except the blog | Exact https://example.com or Starts with https://example.com | Starts with https://example.com/blog |
| One landing page only | Exact match of the full landing URL | — |
| All pricing pages except enterprise | Contains /pricing | Contains /pricing/enterprise |
Cleaning rules (what the runtime actually sees)
People copy URLs from the browser bar, complete with ?utm_source=google and #section. Smart Code often compares origin + pathname only: query and hash stripped, trailing slash normalized. If your Include is an Exact match of a URL that still has a query string, the live page may never match.
Prefer patterns that match the cleaned form. Use Starts with or Contains when a family of paths should qualify. Use Exact when one canonical page should qualify. Use Regex only when those operators cannot express the rule, and test it in the validator — a bad regex fails closed (no match).
URL targeting is not Audience. Pages decide where. The Audience tab (a Data Vista segment) decides who. A visitor on the right URL who fails the segment still does not enter the test.