This component implements the data collection protocol between Edgee and Meta CAPI.
- Download the latest component version from our releases page
- Place the
meta_capi.wasm
file in your server (e.g.,/var/edgee/components
) - Add the following configuration to your
edgee.toml
:
[[components.data_collection]]
id = "meta_capi"
file = "/var/edgee/components/meta_capi.wasm"
settings.meta_access_token = "YOUR_ACCESS_TOKEN"
settings.meta_pixel_id = "YOUR_PIXEL_ID"
settings.meta_test_event_code = "TEST_EVENT_CODE" # Optional
The component maps Edgee events to Meta CAPI events as follows:
Edgee event | Meta CAPI Event | Description |
---|---|---|
Page | PageView |
Triggered when a user views a page |
Track | Name of the event | Uses the provided event name directly |
User | Lead |
Used for lead identification |
User events in Meta CAPI serve multiple purposes:
- Triggers an
Lead
call to Meta CAPI - Stores
user_id
,anonymous_id
, andproperties
on the user's device - Enriches subsequent Page and Track events with user data
- Enables proper user attribution across sessions
[[components.data_collection]]
id = "meta_capi"
file = "/var/edgee/components/meta_capi.wasm"
settings.meta_access_token = "YOUR_ACCESS_TOKEN"
settings.meta_pixel_id = "YOUR_PIXEL_ID"
settings.meta_test_event_code = "TEST_EVENT_CODE" # Optional
# Optional configurations
settings.edgee_default_consent = "pending" # Set default consent status
Control which events are forwarded to Meta CAPI:
settings.edgee_page_event_enabled = true # Enable/disable page view tracking
settings.edgee_track_event_enabled = true # Enable/disable custom event tracking
settings.edgee_user_event_enabled = true # Enable/disable user identification
Prerequisites:
- Rust
- WASM target:
rustup target add wasm32-wasip2
- wit-deps:
cargo install wit-deps
Build command:
make wit-deps
make build
Interested in contributing? Read our contribution guidelines
Report security vulnerabilities to security@edgee.cloud