URL Events
Transforms raw URL values into structured event names based on a configurable URL path tree. Useful when your event column contains page URLs and you want to group or simplify them into meaningful event names.
Usage
es.url_events(
column="event",
nodes=[
{"path": "/product", "is_cut": True},
{"path": "/checkout"},
{"path": "/admin", "is_deleted": True},
],
strip_host=True,
strip_cgi=True,
)
Parameters
| Parameter | Type | Default | Description |
|---|
column | str | required | The column containing raw URL values. |
nodes | list[dict] | required | URL tree nodes. Each dict must have path. See node options below. |
strip_host | bool | True | Remove scheme and hostname, keeping only the path. |
strip_cgi | bool | True | Remove query string and URL fragment. |
strip_locale | bool | True | Remove 2-letter locale prefix from the first path segment (e.g. /en/product → /product). |
host_col | str | None | None | If provided, write the extracted hostname into this new column. |
cgi_col | str | None | None | If provided, write the extracted query string into this new column. |
locale_col | str | None | None | If provided, write the extracted locale code into this new column. |
Node options
| Key | Type | Description |
|---|
path | str | URL path prefix to match. |
is_cut | bool | Collapse all sub-paths under this node into a single event, appending a slug for the remaining path segment. |
is_deleted | bool | Remove all events matching this path prefix. |
custom_name | str | Custom label used as the event name instead of the raw path. |