-
Notifications
You must be signed in to change notification settings - Fork 1
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
c3a1189
commit 4817112
Showing
8 changed files
with
94 additions
and
48 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "piano-analytics-component" | ||
version = "0.1.6" | ||
version = "0.2.0" | ||
edition = "2021" | ||
|
||
[lib] | ||
|
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 |
---|---|---|
@@ -1,70 +1,112 @@ | ||
<div align="center"> | ||
|
||
<p align="center"> | ||
<a href="https://www.edgee.cloud"> | ||
<picture> | ||
<source media="(prefers-color-scheme: dark)" srcset="https://cdn.edgee.cloud/img/favicon-dark.svg"> | ||
<img src="https://cdn.edgee.cloud/img/favicon.svg" height="100" alt="Edgee"> | ||
<source media="(prefers-color-scheme: dark)" srcset="https://cdn.edgee.cloud/img/component-dark.svg"> | ||
<img src="https://cdn.edgee.cloud/img/component.svg" height="100" alt="Edgee"> | ||
</picture> | ||
<h1 align="center">Edgee</h1> | ||
</a> | ||
</p> | ||
</div> | ||
|
||
<h1 align="center">Piano Analytics Component for Edgee</h1> | ||
|
||
**The full-stack edge platform for your edge oriented applications.** | ||
|
||
[![Edgee](https://img.shields.io/badge/edgee-open%20source-blueviolet.svg)](https://www.edgee.cloud) | ||
[![Edgee](https://img.shields.io/badge/slack-edgee-blueviolet.svg?logo=slack)](https://www.edgee.cloud/slack) | ||
[![Docs](https://img.shields.io/badge/docs-published-blue)](https://docs.edgee.cloud) | ||
|
||
</div> | ||
This component implements the data collection protocol between [Edgee](https://www.edgee.cloud) and [Piano Analytics](https://developers.atinternet-solutions.com/piano-analytics/data-collection/how-to-send-events/collection-api). | ||
|
||
This component implements the data collection protocol between [Piano Analytics](https://developers.atinternet-solutions.com/piano-analytics/data-collection/how-to-send-events/collection-api) and [Edgee](https://www.edgee.cloud). | ||
## Quick Start | ||
|
||
1. Download the latest component version from our [releases page](../../releases) | ||
2. Place the `piano.wasm` file in your server (e.g., `/var/edgee/components`) | ||
3. Add the following configuration to your `edgee.toml`: | ||
|
||
### Event mapping: | ||
```toml | ||
[[destinations.data_collection]] | ||
name = "piano" | ||
component = "/var/edgee/components/piano.wasm" | ||
credentials.piano_site_id = "..." | ||
credentials.piano_collection_domain = "..." | ||
``` | ||
|
||
Here is the mapping between Edgee events and Piano events: | ||
## Event Handling | ||
|
||
| Edgee event | Piano Event | | ||
|-------------|-----------| | ||
| Page | `page.display` | | ||
| Track | Name of the event | | ||
| User | - | | ||
### Event Mapping | ||
The component maps Edgee events to Piano Analytics events as follows: | ||
|
||
The User event is not mapped to any Piano event. That means each time you make a `user` call, Edgee won't send any event to Piano Analytics. | ||
| 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 | | ||
|
||
But when you make a `user` call using Edgee's JS library or Data Layer, the `user_id`, `anonymous_id` and `properties` are stored in the user's device. | ||
This allows the user's data to be added to any subsequent page or follow-up calls for the user, so that you can correctly attribute these actions. | ||
### User Event Handling | ||
While User events don't generate Piano Analytics events directly, they serve an important purpose: | ||
- Stores `user_id`, `anonymous_id`, and `properties` on the user's device | ||
- Enriches subsequent Page and Track events with user data | ||
- Enables proper user attribution across sessions | ||
|
||
## Usage | ||
## Configuration Options | ||
|
||
- Download the latest version in our [releases page](../../releases). | ||
- Place the wasm file in a known place in your server (e.g. `/var/edgee/components`). | ||
- Update your edgee proxy config: | ||
### Basic Configuration | ||
```toml | ||
[[destinations.data_collection]] | ||
name = "piano" | ||
component = "/var/edgee/components/piano.wasm" | ||
credentials.piano_site_id = "..." | ||
credentials.piano_collection_domain = "..." | ||
|
||
# Optional configurations | ||
config.anonymization = true # Enable/disable data anonymization in case of pending or denied consent | ||
config.default_consent = "pending" # Set default consent status if not specified by the user | ||
``` | ||
|
||
## Contributing | ||
If you're interested in contributing to Edgee, read our [contribution guidelines](./CONTRIBUTING.md) | ||
### Event Controls | ||
Control which events are forwarded to Piano Analytics: | ||
```toml | ||
config.page_event_enabled = true # Enable/disable page event | ||
config.track_event_enabled = true # Enable/disable track event | ||
config.user_event_enabled = true # Enable/disable user event | ||
``` | ||
|
||
## Reporting Security Vulnerabilities | ||
If you've found a vulnerability or potential vulnerability in our code, please let us know at | ||
[edgee-security](mailto:security@edgee.cloud). | ||
### Consent Management | ||
Before sending events to Google Analytics, you can set the user consent using the Edgee SDK: | ||
```javascript | ||
edgee.consent("granted"); | ||
``` | ||
|
||
## Building from source | ||
Or using the Data Layer: | ||
```html | ||
<script id="__EDGEE_DATA_LAYER__" type="application/json"> | ||
{ | ||
"data_collection": { | ||
"consent": "granted" | ||
} | ||
} | ||
</script> | ||
``` | ||
|
||
To build the wasm file from source, you need to have installed | ||
- [Rust](https://www.rust-lang.org/tools/install) | ||
- `wasm32-wasip2` target: run `rustup target add wasm32-wasip2` | ||
If the consent is not set, the component will use the default consent status. | ||
|
||
Then you can run the following commands: | ||
| Consent | Anonymization | Piano Analytics Consent | | ||
|---------|---------------|-------------------------| | ||
| pending | true | Exempt | | ||
| denied | true | Exempt | | ||
| granted | false | Opt-in | | ||
|
||
## Development | ||
|
||
### Building from Source | ||
Prerequisites: | ||
- [Rust](https://www.rust-lang.org/tools/install) | ||
- WASM target: `rustup target add wasm32-wasip2` | ||
- wit-deps: `cargo install wit-deps` | ||
|
||
Build command: | ||
```bash | ||
make build | ||
``` | ||
|
||
### Contributing | ||
Interested in contributing? Read our [contribution guidelines](./CONTRIBUTING.md) | ||
|
||
### Security | ||
Report security vulnerabilities to [security@edgee.cloud](mailto:security@edgee.cloud) |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[protocols] | ||
url = "https://github.com/edgee-cloud/edgee-wit/archive/refs/tags/v0.2.3.tar.gz" | ||
sha256 = "159e4e2f5236e47d5ef0e831cd13fe5da1696a2050accbefe06b496f9bb35314" | ||
sha512 = "c956cc3eeebcb33639260de09a5f24a2d202d5ebc45afd1c25a5c3edd027a8f1699748d6304bd30564bd3bfe39cd9f99d38c563348fef0cf87a0204d95b6ed3a" | ||
url = "https://github.com/edgee-cloud/edgee-wit/archive/refs/tags/v0.2.4.tar.gz" | ||
sha256 = "9085b0ef016f6c1135e7175fe44db4f9694ce94c8cb9dd0e4b45b330610e4abb" | ||
sha512 = "f06230b4471cb4c09b7a31830e0b1f77e58eba56fe7e6d1c764cbba7193cfc1f7396b520afa1d3a8961f86da3643bca37adca6b81fb5cdf92212a41a54fd5275" |
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 |
---|---|---|
@@ -1 +1 @@ | ||
protocols="https://github.com/edgee-cloud/edgee-wit/archive/refs/tags/v0.2.3.tar.gz" | ||
protocols="https://github.com/edgee-cloud/edgee-wit/archive/refs/tags/v0.2.4.tar.gz" |
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