Skip to content

Commit a19d470

Browse files
EventConfig
1 parent ae56837 commit a19d470

File tree

1 file changed

+38
-14
lines changed

1 file changed

+38
-14
lines changed

website/docs/destinations/event_mapping.mdx

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,12 @@ ignoring them. It's also checking for consent and validate values.
2828

2929
## Config
3030

31-
Besides a general destination configuration, a mapping config is set for a
32-
specific event. Therefore it is defined as
31+
Besides the destinations general configuration, a mapping config is set to
32+
process events individually. The `EventConfig` is defined as
3333
`{ [entity]: { [action]: EventConfig }}`.
3434

35-
A `*` can be used to match all entities or actions and set up common rules. Each
36-
destination requires specific settings which can be configured in the `custom`
37-
section of the mapping.
35+
A generic `"*"` can be used to match all entities and/or actions that are not
36+
explicitly matched.
3837

3938
```ts
4039
{
@@ -51,7 +50,15 @@ section of the mapping.
5150
}
5251
```
5352

54-
<DestinationPush event={event} height={'666px'} labelMiddle={'Config'} eventConfig={false} smallText={true}>
53+
### Example
54+
55+
<DestinationPush
56+
event={event}
57+
height={'666px'}
58+
labelMiddle={'Config'}
59+
eventConfig={false}
60+
smallText={true}
61+
>
5562
{`{
5663
order: {
5764
complete: {
@@ -85,11 +92,18 @@ section of the mapping.
8592
}
8693
},
8794
visible: { batch: 1000, data: "event" },
88-
'*' : { ignore: true }
95+
},
96+
'*' : { // Match all other entities
97+
'*' : { // Match all other actions
98+
ignore: true
99+
}
89100
}
90101
}`}
91102
</DestinationPush>
92103

104+
Change the `event` name to `order visible` and see how the batched mapping is
105+
applied after 1 second.
106+
93107
## EventConfig
94108

95109
The `Destination.Event` mapping for each event supports standardized default
@@ -132,23 +146,34 @@ or an `order` event in Piwik PRO.
132146

133147
### data
134148

149+
The `data` property is used to transform the event data. It fully describes the
150+
data structure for the destination.
151+
See&nbsp;<Link to="#valueconfig">ValueConfig</Link> for detailed usage.
152+
135153
### ignore
136154

137-
The `ignore` property is used to ignore the event.
155+
The `ignore` property is used to ignore the event. If set to `true`, the event
156+
won't get pushed to the destination.
138157

139158
### consent
140159

141160
The `consent` property is used to require a specific state to process the event.
142161

143162
### custom
144163

145-
The `custom` property is used to set up custom properties for the event and
146-
destination's individual settings.
164+
The `custom` property is used for individual destination settings. In most cases
165+
the `data` property is enough. But in special cases a `custom` mapping might
166+
simplify the configuration.
147167

148168
### batch
149169

150-
The `batch` property is used to bundle the events before calling `pushBatch` if
151-
available.
170+
The `batch` property is used to bundle the events before pushing them to the
171+
destination. A destination must offer a `pushBatch` method to use this feature.
172+
The pushed event(s) are an object with the following properties:
173+
174+
- `key`: Name of the used mapping rule
175+
- `events`: An array of the actual events
176+
- `data`: The transformed event data
152177

153178
## ValueConfig
154179

@@ -196,8 +221,7 @@ mapping resolves a value.
196221
### map
197222

198223
Used to create an object. The keys are the property names and the values are
199-
again `Mapping.Data` which are `ValueConfig` (@TODO was ist das) resolving to a
200-
`WalkerOS.Property`.
224+
again a&nbsp;<Link to="#valueconfig">ValueConfig</Link> resolving to a value.
201225

202226
<DestinationPush event={{ globals: event.globals, context: event.context }}>
203227
{`{

0 commit comments

Comments
 (0)