Pages & URL targeting

Documents / AB Testing

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

WordEveryday meaningMeaning in CROForge
PagesThe web pages where something should happen.The Configuration sub-tab that stores URL include and exclude rules for this campaign.
URL targetingChoosing 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 typeHow 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.
ValidatorA checker that tells you if a sample would pass.Paste sample URLs and see whether they would be targeted before you launch.
OriginThe 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.
PathnameThe 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

FieldEveryday meaningHow CROForge uses it
Match typeThe comparison style.Exact, Contains, Starts with, Regex, and related operators from the conditions system.
URL patternThe text you are matching against.Usually written as origin plus path, matching the cleaned form Smart Code actually sees.
Include / ExcludeWhich list the rule belongs to.Include allows; Exclude blocks. Both are evaluated on every eligible page load.

How to set Pages

  1. Open the campaign → Configuration → Pages.
  2. Add at least one Include rule for the page or section you intend to test.
  3. Add Exclude rules for look-alike URLs that should stay out (blog, enterprise pricing, app subpaths).
  4. Paste real sample URLs into the validator and confirm each would be in or out as you expect.
  5. Save, then continue to Variations.

Client examples

GoalIncludeExclude
Entire marketing site except the blogExact https://example.com or Starts with https://example.comStarts with https://example.com/blog
One landing page onlyExact match of the full landing URL
All pricing pages except enterpriseContains /pricingContains /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.

Related reading