Variables, Events, and Processing Rules
Get the mechanics right before the reports
Variables, events, and processing rules determine what actually lands in reports. For eVars, know allocation (recent/last, original/first, linear) and expiry (hit, visit, page view, event, custom, never). For events, know counter vs numeric vs currency, and serialization to deduplicate (once per visit, once per visitor). For props, know list enablement and delimiter behavior. Processing rules (and VISTA) run server-side on incoming hits and can copy, set, or delete values, trigger events, and apply conditions; they are powerful but invisible in the client, so document them.
Concepts you must know
Understand context data (contextData / c.*) and how processing rules or the datastream map it to variables. Know list vars and merchandising eVars (product syntax vs conversion syntax) and their interaction with the products variable. Understand the products string format: category;product;quantity;price;events. Know that processing rules cannot reference all variables equally and have ordering effects. Know that classification rules import metadata against a key and do not alter the collected value.
Traps in questions
- Using a processing rule to set a variable that the client already sets, causing conflicting values.
- Forgetting that processing rules apply only to hits arriving after the rule is enabled; no backfill.
- Merchandising eVar syntax errors - mixing product and conversion syntax incorrectly.
- Assuming numeric events accept non-numeric strings; they fail or record zero.
- Confusing classification (metadata on a key) with processing rules (modify hit values).
Worked example
To capture internal search terms as a visit-scoped eVar, send c.searchTerm in context data, create a processing rule that sets eVar5 to c.searchTerm when present, and configure eVar5 with visit expiry. Verify in the debugger that the context data is sent, then check the report after the rule propagates.