Skip to main content

Rule-based URL Tagging (Quick Guide)

Rule tags apply to pages by matching their URL against a glob pattern. Matching is case-insensitive. We normalize URLs by stripping scheme and www., lowercasing, and trimming trailing slashes. If your pattern includes ?, the query string is matched; otherwise, it’s ignored. Basics
  • * matches exactly one path (or query) segment (no / inside)
  • ** matches any depth (may include /)
  • Include ? in the pattern to match query order and keys literally, with */** wildcards inside values
Examples
Exact
pattern: youtube.com/contact
matches: /contact

Single segment
pattern: youtube.com/user/*/profile
matches: /user/alice/profile
does not match: /user/a/b/profile

Any depth
pattern: youtube.com/docs/**
matches: /docs, /docs/v1, /docs/v1/api/reference

End-with leaf at any depth
pattern: youtube.com/**/videos
matches: /channel/UC123/videos, /user/alice/videos
does not match: /videos (requires at least one segment before /videos)

Require at least one segment before leaf
pattern: youtube.com/**/about
matches: /channel/UC123/about, /user/alice/about
does not match: /about
Query param (simple)
pattern: youtube.com/search?q=**
matches: /search?q=, /search?q=test, /search?q=x&sort=new

pattern: youtube.com/search?**
matches: /search (empty query), /search?q=x, /search?q=x&sort=new
Tips
  • Don’t include https:// or www. in patterns; we strip them automatically
  • Use ** when depth varies; use * when it must be one segment
  • To match query params, include ? and write the keys in order you expect