Access your interface

Enter your email address to access your personal interface.

Flutter

Updated 1 July 2026

Prerequisites

ItemVersion / Platform
Flutter>= 3.3.0
Dart SDK>= 2.18.0 < 4.0.0
Supported platformsiOS, Android, Web

Installation

Add the package to your app with the following command:

flutter pub add eanalytics

You can also declare it manually in your pubspec.yaml file:

dependencies:
  eanalytics: ^1.1.1

Then import the SDK in your Dart code:

import "package:eanalytics/eanalytics.dart";

Quick start

1. Initialise the SDK

Initialise the SDK once, before any tracking request.

Call Eulerian.init at the root of your app, for example in the initState of your main widget.

await Eulerian.init("example.demo.com");

During initialisation, the SDK also tries to replay tracking requests that previously failed and were stored locally.

Available parameters

ParameterTypeDefaultDescription
domainString-Dedicated Eulerian tracking domain. It must not contain .eulerian.com.
requestTrackingAuthorizationboolfalseiOS only. Shows the App Tracking Transparency dialogue in order to collect the IDFA.
enableLoggerbooltrueTurns the SDK’s console logs on or off.

2. Track events

Call Eulerian.track from anywhere in your app, passing it a list of trackable properties.

Eulerian.track([
  EAProducts(path: 'produit|fiche')
    ..addProduct(Product(ref: 'p1', name: 'Product 1', group: 'test_group'))
]);

Standard events are sent in a batch through a POST request to the Eulerian collector.

If the request fails, the payloads are stored locally and replayed automatically:

  • on the next call to Eulerian.track;
  • or on the next app launch, after Eulerian.init.

API reference

Eulerian

Eulerian is the SDK’s main singleton.

MethodDescription
Eulerian.init(domain, {requestTrackingAuthorization, enableLogger})Initialises the SDK and replays the locally stored payloads.
Eulerian.track(List<EAProperty> properties)Tracks a list of properties. EATpView and EATpClick events are sent via GET; all other events are grouped into a single POST.
Eulerian.uid()Returns the device identifier used as euidl: the Android ID on Android, identifierForVendor on iOS. Returns an empty string if the SDK is not initialised.

Trackable events

EAProperty

EAProperty is the base class of every trackable event.

It can also be used directly to track a simple page view.

The constructor requires a path, the page name. As with the native SDKs, use a hierarchical convention with | as the separator, for example 'home|accueil' or 'tunnel|paiement|confirmation': it is the same page taxonomy as the one in the reports. The SDK adds the leading / if it is missing, so the value reported is /home|accueil.

Eulerian.track([
  EAProperty(path: 'home|accueil')
    ..setEmail('johndoe@example.com')
    ..setUID('user-42')
    ..setPageGroup('homepage')
]);

Available setters

These setters are inherited by every event model.

MethodPayload keyDescription
setPath(String path)pathPath of the event’s page.
setLocation({latitude, longitude})ea-lat, ea-lonGeographic coordinates.
setNewCustomer(bool isNew)newcustomerFlags the visitor as a new customer: 1 or 0.
setStandalone()ereplay-notagFlags the hit as a standalone call, with no page view counted.
setEmail(String email)emailThe visitor’s email address, hashed as lower-case hexadecimal SHA-256.
setLabel(String label)pagelabelPage label. Comma-separated values are allowed.
setUID(String uid)uidVisitor identifier supplied by your app.
setProfile(String profile)profileVisitor profile.
setPageGroup(String group)pagegroupPage group.
setAction(Action action)actionAttaches an action to the page.
setProperty(SiteCentric property)propertySite-centric properties.
setCFlag(SiteCentric cFlag)cflagSite-centric conversion flags.
setCustomParam(String key, String value)<key>Adds a custom key/value pair.

Event models

Every model below extends EAProperty.

So the EAProperty setters are available on each of them.

EAProducts · Product display

Tracks the display of one or more products.

Eulerian.track([
  EAProducts(path: 'produit|fiche')
    ..addProduct(Product(ref: 'p1', name: 'Product 1', group: 'shoes'))
    ..addProduct(Product(ref: 'p2', name: 'Product 2', group: 'shoes')),
]);

MethodDescription
addProduct(Product product)Adds a product to the products list.

EACart · Shopping cart

Tracks the contents of the visitor’s cart.

The scart flag is set automatically.

Eulerian.track([
  EACart(path: 'panier')
    ..setCartCumul(true)
    ..addProduct(product: Product(ref: 'p1'), amount: 19.99, quantity: 2),
]);

MethodDescription
setCartCumul(bool cumul)If true, the cart is cumulative, with scartcumul.
addProduct({product, amount, quantity})Adds a product to the cart. amount and quantity are applied to the product if they are not already set.

EAEstimate · Quote or estimate

Tracks a pre-sale quote.

The estimate flag is set automatically.

Eulerian.track([
  EAEstimate(path: 'credit|devis', ref: 'EST-001')
    ..setAmount(149.90)
    ..setCurrency('EUR')
    ..setType('quote')
    ..setPayment('card')
    ..addProduct(product: Product(ref: 'p1'), amount: 149.90, quantity: 1),
]);

MethodPayload keyDescription
setAmount(double amount)amountTotal amount.
setCurrency(String currency)currencyCurrency code.
setType(String type)typeQuote type.
setPayment(String payment)paymentPayment method.
addProduct({product, amount, quantity})productsAdds a product to the quote.

EAOrder · Confirmed purchase

Tracks a confirmed order.

EAOrder extends EAEstimate, so every EAEstimate setter is available.

The constructor lets you link the order to an earlier quote through estimateRef.

Eulerian.track([
  EAOrder(path: 'tunnel|confirmation', estimateRef: 'EST-001')
    ..setAmount(149.90)
    ..setCurrency('EUR')
    ..setPayment('card')
    ..addProduct(product: Product(ref: 'p1'), amount: 149.90, quantity: 1),
]);

MethodPayload keyDescription
setEstimateRef(String ref)estimaterefReference of the original quote.

Tracks a query made in the app’s internal search engine.

Eulerian.track([
  EASearch(
    path: 'moteur_interne|veste',
    search: Search(name: 'shoes', results: 42),
  ),
]);

EAActions · User actions

Tracks one or more user actions, such as clicks or interactions.

Combine it with setStandalone() when the hits contain only actions and must not be counted as page views.

Eulerian.track([
  EAActions(path: '')
    ..setStandalone()
    ..addAction(Action(name: 'button1', mode: 'in'))
    ..addAction(Action(name: 'newsletter', label: 'footer')
      ..setParams(Params()..addParam('input', 'test'))),
]);

MethodDescription
addAction(Action action)Adds an action to the actions list.

Utility classes

The following classes are the building blocks used by the various event models.

Product

Represents a product.

Product(
  ref: 'p1',
  name: 'Product 1',
  group: 'shoes',
  parameters: Params()..addParam('color', 'red'),
)
  ..setAmount(19.99)
  ..setQuantity(2);

Main fields

FieldDescription
refProduct reference. This field is required.
nameProduct name.
groupProduct group.
parametersCustom parameters attached to the product.

Action

Represents a user action.

Action(name: 'button1', mode: 'in', label: 'lbl1,lbl2', ref: 'ref1')
  ..setParams(Params()..addParam('input', 'test'));

FieldDescription
nameAction name. This field is required.
modeAction mode. Optional.
labelAction label. Optional.
refReference attached to the action. Optional.

Params

Lets you add arbitrary key/value parameters to products, actions and searches.

Params.fromEntries([MapEntry("foo", "bar"), MapEntry("baz", [1, 2, 3])]);

Or with addParam:

Params()..addParam('foo', 'bar');

Describes an internal search used by EASearch.

Search(
  name: 'shoes',
  results: 42,
  parameters: Params()..addParam('foo', 'bar'),
);

SiteCentric

Lets you supply site-centric keys and values for setProperty and setCFlag.

Each value is a list of strings. A tag accepts at most 10 context flag values, across all dimensions.

SiteCentric()..addParam('prop', ['foo', 'baz']);

Merchandising tracking

The SDK provides a dedicated merchandising tracking flow for impressions and clicks on product showcases, recommendation lists and similar surfaces.

Two models are available:

ModelUseSent as
EATpViewMerchandising impressionGET /tpview/
EATpClickMerchandising clickGET /tpclick/

Unlike other events, which are sent as POST to the standard collector, merchandising events are sent through GET requests on dedicated paths.

If a request fails, the payload is stored locally and replayed with the next pending POST batch.

Merchandising request format

Impression

https://<domain>/tpview/<siteName>/<campaignName>/<placement>/<siteName>/generic/<random>
       ?evprdr0=<ref>&evprdpos0=<position>&...&url=<encoded page url>&<global context>

Click

https://<domain>/tpclick/<siteName>/<campaignName>/<placement>/<siteName>/generic/<random>
       ?ecprdr=<ref>&ecpos=<position>&ecnbr=<total>&eurl=<encoded landing url>&<global context>

Global context added automatically

The SDK automatically adds the global context parameters to every merchandising request.

No extra code is needed.

The parameters added are the same as those used in calls to the collector:

  • euidl
  • ea-appname
  • eos
  • ehw
  • advertising identifiers:
    • ea-android-adid
    • ea-ios-idfa
    • ea-ios-idfv
  • device qualification through edev

Possible values for edev:

  • AppNativeIOSphone
  • AppNativeIOStablet
  • AppNativeAndroidphone
  • AppNativeAndroidtablet

These values flag the traffic as coming from a native app.

The visitor identifier uid is also added when it is set on the event through setUID().

Shared descriptors

EATpView and EATpClick expose the same campaign descriptors:

PropertyDescription
siteNameSite name.
campaignNameCampaign name.
placementPlacement where it is served.
urlURL attached to the event.

What url means depends on the event type:

ModelMeaning of urlParameter sent
EATpViewURL of the current pageurl
EATpClickDestination URL of the clicked producteurl

EATpView · Merchandising impression

final view = EATpView(path: 'homepage')
  ..siteName = 'my-site'
  ..campaignName = 'summer_sale'
  ..placement = 'banner_top'
  ..url = 'https://www.example.com/home'
  ..addProduct('PROD_001', position: 0)
  ..addProduct('PROD_002', position: 1);

Eulerian.track([view]);

MethodDescription
addProduct(String ref, {int? position})Adds a displayed product, with its optional position in the block.
setProducts(List<List<dynamic>> products)Replaces the whole product list. Entries can be [ref] or [ref, position].

EATpClick · Merchandising click

final click = EATpClick(path: 'homepage')
  ..siteName = 'my-site'
  ..campaignName = 'summer_sale'
  ..placement = 'banner_top'
  ..url = 'https://www.example.com/home'
  ..setProduct('PROD_001', 0);

Eulerian.track([click]);

MethodDescription
setProduct(String ref, int position, {int? totalProducts})Sets the clicked product, its position and, optionally, the total number of products in the block.
setProductMap(Map<String, dynamic> product)Sets the product from a raw map with the keys ref, position and totalProducts.

Global properties

The SDK automatically attaches the following properties to every payload, depending on the platform.

Property nameEAPropertyKeyiOSAndroidWeb
ehwEAPropertyKey.EHW✔✔✔
eosEAPropertyKey.EOS✔✔✔
euidlEAPropertyKey.EUIDL✔✔✘
ea-appnameEAPropertyKey.APPNAME✔✔✔
ea-appversionEAPropertyKey.APP_VERSION✔✔✔
urlEAPropertyKey.URL✔✔✔
ea-ios-idfvEAPropertyKey.IOS_IDFV✔✘✘
ea-ios-idfaEAPropertyKey.IOS_ADID✔✘✘
ea-android-adidEAPropertyKey.ANDROID_ADID✘✔✘
ea-android-referrerEAPropertyKey.INSTALL_REFERRER✘✔✘
ereplay-timeEAPropertyKey.EPOCH✔✔✔
ea-flutter-sdk-versionEAPropertyKey.SDK_VERSION✔✔✔

Notes:

  • The url property is:
    • the bundle identifier on iOS;
    • the package name on Android;
    • the path of the current URL on the Web.
  • The ea-ios-idfa property requires the requestTrackingAuthorization option when the SDK is initialised on iOS.

iOS configuration

If you want to use the IDFA advertising identifier, you need to update the Info.plist file.

The file is usually in the following directory:

ios/Runner/Info.plist

Add the NSUserTrackingUsageDescription key with a message describing your use:

<key>NSUserTrackingUsageDescription</key>
<string>This identifier will be used to deliver personalized analytics.</string>

If your app calls the App Tracking Transparency API, this string is mandatory. It is shown in the system permission alert.

Then pass the requestTrackingAuthorization option when initialising the SDK:


void initState() {
  Eulerian.init('example.demo.com', requestTrackingAuthorization: true);
  super.initState();
}

Offline retry

Failed tracking requests are stored locally through shared_preferences.

This covers, in particular:

  • network errors;
  • non-2xx HTTP responses.

Stored payloads are replayed automatically:

  • on the next call to Eulerian.track, merged with the new batch;
  • or on the next app launch, once Eulerian.init has finished.

Example app

A complete example app for iOS, Android and the Web is available in the following directory:

example/