https://github.com/euleriantechnologies/eanalytics-flutter
Flutter SDK for Eulerian Analytics
https://github.com/euleriantechnologies/eanalytics-flutter
analytics attribution mta
Last synced: 11 months ago
JSON representation
Flutter SDK for Eulerian Analytics
- Host: GitHub
- URL: https://github.com/euleriantechnologies/eanalytics-flutter
- Owner: EulerianTechnologies
- License: mit
- Created: 2021-04-26T10:26:21.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-03T17:39:34.000Z (about 2 years ago)
- Last Synced: 2025-06-04T09:28:24.449Z (12 months ago)
- Topics: analytics, attribution, mta
- Language: Dart
- Homepage:
- Size: 490 KB
- Stars: 1
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# EAnalytics - Flutter SDK
## Initialization
Call `Eulerian.init` **ONCE** before any tracking request at the top-level of your app.
It will try to sync any failed tracking attemps locally stored.
```dart
await Eulerian.init('test.domain.dev')
```
> You can optionnally request tracking authorization for iOS devices by passing the requestTrackingAuhtorization flag to the init method.
To track `EAProperties`, call `Eulerian.track` from anywhere in your flutter app.
If the POST request fails, it will be stored in local storage for future retry.
> EAProperties include EACart, EAEstimate, EAOrder, EAProducts, EASearch -
> Additional models are here to help building EAProperties : Action, Params, Product, Search, SiteCentric
```dart
Eulerian.track([
EAProducts(path: '/add/products')
..addProduct(Product(ref: 'p1', name: 'Product 1', group: 'test_group'))
])
```
## iOS Setup 📱
If you're planning on using the advertisingIdentifier : make sure you update your `Info.plist` file located in ios/Runner directory and add the `NSUserTrackingUsageDescription` key with a custom message describing your usage
```xml
NSUserTrackingUsageDescription
Request tracking...
```
> If your app calls the App Tracking Transparency API, you must provide custom text, known as a usage-description string, which displays as a system-permission alert request.
When initializing EAnalytics, pass the `requestTrackingAuthorization` flag to prompt user for tracking authorization
```dart
@override
void initState() {
Eulerian.init('domain.name', requestTrackingAuthorization: true);
super.initState();
}
```
### Global EAnalytics Properties
EAnalytics will internally handle setting the following properties on your payloads based on your platform.
| property name | EAPropertyKey | iOS | Android | Web |
| ---------------------- | ---------------------------- | --- | ------- | --- |
| ehw | `EAPropertyKey.EHW` | ✔ | ✔ | ✔ |
| eos | `EAPropertyKey.EOS` | ✔ | ✔ | ✔ |
| euidl | `EAPropertyKey.EUIDL` | ✔ | ✔ | ✘ |
| ea-appname | `EAPropertyKey.APPNAME` | ✔ | ✔ | ✔ |
| ea-appversion | `EAPropertyKey.APP_VERSION` | ✔ | ✔ | ✔ |
| url \* | `EAPropertyKey.URL` | ✔ | ✔ | ✔ |
| ea-ios-idfv | `EAPropertyKey.IOS_IDFV` | ✔ | ✘ | ✘ |
| ea-ios-idfa \*\* | `EAPropertyKey.IOS_ADID` | ✔ | ✘ | ✘ |
| ea-android-adid | `EAPropertyKey.ANDROID_ADID` | ✘ | ✔ | ✘ |
| ereplay-time | `EAPropertyKey.EPOCH` | ✔ | ✔ | ✔ |
| ea-flutter-sdk-version | `EAPropertyKey.SDK_VERSION` | ✔ | ✔ | ✔ |
> (\*) url property will be mapped to bundleIdentifier on iOS, getPackageName on Android, and current url path on web platform.
> (\*\*) ea-ios-idfv require requestTrackingAuthorization flag on eanalytics initialization on iOS.
### Flutter SDK version
`>=2.12.0`