Skip to content

EulerianTechnologies/eanalytics-flutter

Repository files navigation

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.

  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

  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

<key>NSUserTrackingUsageDescription</key>
<string>Request tracking...</string>

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

  @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

About

Flutter SDK for Eulerian Analytics

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •