Mapping
The mapping is used to translate events into another required format. It converts the walkerOS event model into another format. The mapping also defines how to process events, like renaming, bundling, or ignoring them.
There are common rules for destinations like name
to for renaming an event
(e.g. product add
to add_to_cart
) or ignore
to not process an event at
all. A *
can be used to match all entities or actions and set up common rules.
Each destination requires specific settings which can be configured in the
custom
section of the mapping.
const mapping = {
entity: { action: {} }, // Basic structure
page: {
view: { name: 'pageview' }, // Rename the event name
click: { custom: { language: 'globals.language' } }, // Custom settings
},
product: {
visible: { batch: 2000 }, // Bundle all product visible events
},
// Set custom properties
order: { complete: { name: 'purchase' } },
'*': { '*': { ignore: true } }, // Ignore all other non-listed events
};
The EventConfig
for each event supports standardized default options. The
custom
option can be used to set up custom properties for the event and
destinations individual settings.
Property | Value | Description |
---|---|---|
batch | number | Time in ms to bundle the events before calling pushBatch if available. |
custom | object | Individual settings for a custom destination. |
ignore | boolean | If set to true the event won't get pushed to the destination. |
name | string | Renaming of the event (e.g. product add to add_to_cart ) |
To disable processing events, add {'*': {'*': { ignore: true }}}
to the
mapping.
Make sure to not list duplicate keys in the mapping, since this is an object.
Use Utils/Hooks to modify events before processing.