-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c282d67
commit f5fa8b0
Showing
11 changed files
with
227 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
title: Mapping | ||
description: How to transform events into another required format. | ||
--- | ||
|
||
import Link from '@docusaurus/Link'; | ||
|
||
The mapping is used to translate events into another required format. It | ||
converts the <Link to="/docs/walkeros/event-model">walkerOS event | ||
model</Link> 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. | ||
|
||
```js | ||
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. | ||
|
||
:::info | ||
|
||
Use <Link to="/docs/utils/hooks">Utils/Hooks</Link> to modify events before | ||
processing. | ||
|
||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
title: Meta Conversion API | ||
description: Meta Conversion API (CAPI) destination for walkerOS | ||
--- | ||
|
||
import Link from '@docusaurus/Link'; | ||
import PackageLink from '/src/components/docs/package-link'; | ||
|
||
<PackageLink | ||
github="packages/destinations/node/meta" | ||
npm="@elbwalker/destination-node-meta" | ||
/> | ||
|
||
The <Link to="https://developers.facebook.com/docs/marketing-api/conversions-api">Meta | ||
Conversion API (CAPI)</Link> destination is used to send server-side events from | ||
walkerOS to the Facebook Conversion API. It handles the data transformation and | ||
ensures that your events are correctly formatted for the Facebook Conversion | ||
API. | ||
|
||
## Basic example | ||
|
||
Here's a simple example to demonstrate how to configure the Meta destination: | ||
|
||
```ts | ||
import { destinationMeta } from '@elbwalker/destination-node-meta'; | ||
|
||
await elb('walker destination', destinationMeta, { | ||
custom: { | ||
accessToken: 's3cr3tc0d3', | ||
pixelId: '1234567890', | ||
// debug: true, | ||
// partner: 'walkerOS', | ||
// testCode: 'TEST00000', | ||
}, | ||
mapping: { | ||
// e.g. order | ||
entity: { | ||
// e.g. complete | ||
action: { | ||
name: 'Purchase', | ||
custom: { | ||
id: 'data.id', | ||
name: 'data.title', | ||
value: 'data.total', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}); | ||
``` | ||
|
||
## Dependencies | ||
|
||
Before using the Meta destination, ensure you have: | ||
|
||
- walkerOS Node client installed | ||
- <Link to="https://developers.facebook.com/docs/marketing-api/conversions-api/get-started#requirements"> | ||
Conversion API requirements | ||
</Link> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters