This component enables seamless integration between Edgee and Amplitude, allowing you to collect and forward analytics data while respecting user privacy settings.
- Download the latest component version from our releases page
- Place the
amplitude.wasmfile in your server (e.g.,/var/edgee/components) - Add the following configuration to your
edgee.toml:
[[components.data_collection]]
id = "amplitude"
file = "/var/edgee/components/amplitude.wasm"
settings.amplitude_api_key = "..." # Your Amplitude API KeyThe component maps Edgee events to Amplitude events as follows:
| Edgee Event | Amplitude Event | Description |
|---|---|---|
| Page | [Amplitude] Page Viewed |
Triggered when a user views a page (includes session_start/session_end if needed) |
| Track | Custom Event | Uses the provided event name directly |
| User | identify |
Used for user identification |
User events in Amplitude serve multiple purposes:
- Triggers an
identifycall to Amplitude - Stores
user_id,anonymous_id, andpropertieson the user's device - Enriches subsequent Page and Track events with user data
- Enables proper user attribution across sessions
[[components.data_collection]]
id = "amplitude"
file = "/var/edgee/components/amplitude.wasm"
settings.amplitude_api_key = "..."
# Optional configurations
settings.amplitude_endpoint = "..." # The default value is https://api2.amplitude.com/2/httpapi
settings.edgee_anonymization = true # Enable/disable data anonymization
settings.edgee_default_consent = "pending" # Set default consent statusControl which events are forwarded to Amplitude:
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 identificationBefore sending events to Amplitude, you can set the user consent using the Edgee SDK:
edgee.consent("granted");Or using the Data Layer:
<script id="__EDGEE_DATA_LAYER__" type="application/json">
{
"data_collection": {
"consent": "granted"
}
}
</script>If the consent is not set, the component will use the default consent status.
| Consent | Anonymization |
|---|---|
| pending | true |
| denied | true |
| granted | false |
Prerequisites:
- Rust
- WASM target:
rustup target add wasm32-wasip2
Build command:
make buildInterested in contributing? Read our contribution guidelines
Report security vulnerabilities to security@edgee.cloud