This component implements the data collection protocol between Edgee and Piano Analytics.
- Download the latest component version from our releases page
- Place the
piano.wasmfile in your server (e.g.,/var/edgee/components) - Add the following configuration to your
edgee.toml:
[[components.data_collection]]
id = "piano"
file = "/var/edgee/components/piano.wasm"
settings.piano_site_id = "..."
settings.piano_collection_domain = "..."
settings.piano_collect_utm_as_properties = "true"The component maps Edgee events to Piano Analytics events as follows:
| Edgee Event | Piano Analytics Event | Description |
|---|---|---|
| Page | page.display |
Triggered when a user views a page |
| Track | Custom Event | Uses the provided event name directly |
| User | N/A | Used for user identification only |
While User events don't generate Piano Analytics events directly, they serve an important purpose:
- 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 = "piano"
file = "/var/edgee/components/piano.wasm"
settings.piano_site_id = "..."
settings.piano_collection_domain = "..."
settings.piano_collect_utm_as_properties = "true"
# Optional configurations
settings.edgee_anonymization = true # Enable/disable data anonymization in case of pending or denied consent
settings.edgee_default_consent = "pending" # Set default consent status if not specified by the userTo find out more about using piano_collect_utm_as_properties, please refer to Piano documentation.
Control which events are forwarded to Piano Analytics:
settings.edgee_page_event_enabled = true # Enable/disable page event
settings.edgee_track_event_enabled = true # Enable/disable track event
settings.edgee_user_event_enabled = true # Enable/disable user eventBefore sending events to Google Analytics, 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 | Piano Analytics Consent |
|---|---|---|
| pending | true | Exempt |
| denied | true | Exempt |
| granted | false | Opt-in |
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