Create / Transform Events Server-Side
Event Creation Rules
Event Creation Rules let you automatically create or transform tracking events based on data arriving in Tracklution without changing your website code or dataLayer. You define the logic once, and Tracklution applies it to every matching event in real time.
Common use cases include remapping webhook fields to standard event fields, splitting a single event type by order source, optimizing ad platform conversions on profit instead of revenue, and filtering out test or internal orders.
Event Creation Rules is a beta feature. Rules run directly in the live event collection pipeline. Test carefully before applying rules to production traffic. See Before you start below.
Before you start
When you create your first rule, Tracklution shows a disclaimer you must acknowledge before proceeding. It covers four points you should keep in mind throughout:
- Production impact: Rules run in the live event collection pipeline. A misconfigured rule can create unexpected events, alter conversion values, or discard original events.
- No undo: Once an event is discarded or a synthetic event is delivered to connectors, it cannot be reversed.
- Testing recommended: Test rules with low-traffic events or in a staging container before applying them to production traffic.
- Beta limitations: The feature is under active development. Behaviour may change, and edge cases may not be fully handled yet.
Where to find it
Go to Settings → Event Creation Rules. This area lists all existing rules with their status, source event, and output event. Use the + Create Rule button in the top-right corner to add a new rule.
How a rule works
Each rule follows this logic:
When a
[SourceEvent]event arrives and[conditions are met], create a new event called[OutputEvent]with[field mappings], then[discard / keep]the original event and[render / do not render]a pixel for the new event.
Rules are evaluated as soon as a matching event arrives. If conditions are not met, the rule is skipped and the original event continues as normal.
Create a rule
- Go to Settings → Event Creation Rules.
- Click + Create Rule.
- If this is your first rule, read the beta disclaimer and click I understand, proceed.
- In the Rule name field, enter a descriptive name (e.g.
Revenue Purchase).
Set the trigger
- In the When a ___ event arrives field, enter the name of the source event that should trigger the rule (e.g.
Purchase).
Add conditions
- Click + Add condition to add a filter. Each condition has:
- A field path (e.g.
webhook.revenue,webhook.source_name) - An operator (e.g.
exists,equals,contains) - A value (for operators that require one)
- A field path (e.g.
- Repeat for each additional condition. All conditions must be true for the rule to fire (AND logic).
Name the output event
- In the create a new event called field, enter the name for the new event (e.g.
Purchase,PurchasePOS,ProfitMargin).
Map fields
- Click + Add field mapping to map a field on the new event to a value or expression. Each mapping has:
- A target field (e.g.
value,currency) - A source expression (e.g.
webhook.revenue,webhook.revenue-webhook.cost)
- A target field (e.g.
- Repeat for each field you want to set on the new event.
Set the original event behavior
-
In the Then section, choose what happens to the original event:
- Discard: the original event is dropped and not forwarded to connectors.
- Keep: the original event is kept and the new event is added.
-
Choose whether to render a pixel for the new event:
- Do not render: the new event is delivered to server-side connectors only.
- Render: the new event is delivered to server-side connectors and renders a browser pixel.
-
Click Save.
Manage existing rules
On the Event Creation Rules, each rule shows:
| Column | Description |
|---|---|
| Name | The rule name and a short summary of its logic. |
| Status | Whether the rule is active or paused. |
| Source Event | The event type that triggers the rule. |
| Output Event | The name of the event the rule creates. |
Use Edit to modify a rule, Status to toggle active / paused, or Remove to delete it permanently.
Example use cases
These are examples of how you can use the Event Creation Rules feature. You can use different names for your output event, and different trigger and condition rules that suit your use case.
Route by order source
Split POS orders from web orders into separate events.
- Trigger:
Purchase - Condition:
webhook.source_nameequalspos - Output event:
PurchasePOS - Original event: discard
Optimise on profit, not revenue
Send margin-based values to ad platforms instead of gross revenue.
- Trigger:
Purchase - Output event:
ProfitMargin - Field mapping:
value=value - webhook.cost_of_goods - webhook.shipping_cost - Original event: keep, do not render pixel for new event
Send VAT-excluded values to ad platforms
- Trigger:
Purchase - Output event:
Purchase - Field mapping:
value=value - webhook.total_tax - Original event: discard
Remap webhook fields to standard fields
Useful when your webhook uses non-standard field names.
- Trigger:
Purchase - Output event:
Purchase - Field mappings:
value=webhook.revenue,currency=webhook.currencyCode - Original event: discard
Track affiliate conversions separately
- Trigger:
Purchase - Condition:
source_aliasequalsaffiliate - Output event:
PurchaseAwin - Original event: keep, render pixel for new event
Identify first-time buyers
- Trigger:
Purchase - Condition:
webhook.isFirstOrderequalstrue - Output event:
NewCustomerPurchase
Exclude test orders
- Trigger:
Purchase - Condition:
event_source_urlcontainsstaging.myshop.com - Output event:
PurchaseTest - Original event: discard
Limitations and known behavior
- Event Creation Rules is in beta. Edge cases may not behave as expected, open a chat to contact support if you have unexpected issues.
- Rules cannot be undone. Discarded events and delivered synthetic events are permanent.
- Not yet available on all servers, open a chat to contact support if you want to use this feature but can’t find it.