Access your interface

Enter your email address to access your personal interface.

React Native

Updated 5 October 2026

Installation

Native dependencies

The SDK relies on the following React Native libraries. Add them to your project:

npm install \
  @react-native-async-storage/async-storage \
  @react-native-community/netinfo \
  @sparkfabrik/react-native-idfa-aaid \
  react-native-device-info \
  react-native-fs \
  react-native-logs \
  react-native-play-install-referrer

iOS configuration

Link the native dependencies:

cd ios && pod install

To collect the IDFA, which is optional, add the NSUserTrackingUsageDescription key to your Info.plist:

<key>NSUserTrackingUsageDescription</key>
<string>This app uses the advertising identifier to personalize content.</string>

Android configuration

react-native-play-install-referrer needs no manual configuration beyond standard autolinking.

For @sparkfabrik/react-native-idfa-aaid, your android/build.gradle must declare minSdkVersion >= 21.

Integrating the SDK

Copy the repository’s src/ folder into your project. The expected structure is:

  • src/eAnalytics.ts
  • src/models/: eaGeneric.ts, eaCart.ts, eaEstimate.ts, eaOrder.ts, eaProducts.ts, eaSearch.ts, eaMerchandising.ts
  • src/models/classes/: action.ts, params.ts, product.ts, siteCentricCFlag.ts, siteCentricProperty.ts
  • src/utils/: currencyISO.ts and the other utilities

Supported versions: React >=18.2.0 · React Native >0.72.4 · Node >=16.

Initialisation

Call EAnalytics.init once only when the app starts, before any call to track. The SDK is a singleton: a second call to init is ignored.

import EAnalytics from './src/eAnalytics';

// In the root component or the app's entry point
useEffect(() => {
  EAnalytics.init("example.demo.com", false);
}, []);

The second parameter turns debug logs in the console on (true) or off (false).

Tracking subdomain: the value to pass is supplied by your Eulerian team. It looks like example.demo.com, without https:// or /. The SDK rejects hosts containing .eulerian.com.

Offline and resending: if the device has no connection when track is called, the tag is serialised locally and sent again automatically on the next track or the next app launch. The real timestamp of the interaction is kept (ereplay-time).

Android, Install Referrer: on first launch, the SDK automatically collects the Google Play install referrer and adds it to the following tags (ea-android-referrer).

Tag types

Every model in the SDK uses an internal Builder class with a fluent API: each method returns this, and .build() creates the final instance.

const tag = new ModelClass.Builder("page/path")
  .setUID("123")
  .setEmail("user@example.com")
  // ... other methods
  .build();

EAnalytics.track(tag);

The path, that is, the page name, is mandatory on every tag. It is never inferred automatically. Use a hierarchical convention with | as the separator, for example "home|landing", "catalog|shoes|men" or "funnel|payment|confirmation". The value is up to you, but it must stay stable and readable in reporting.

Generic method .set(key, value): available on every Builder, it lets you add any custom parameter that no dedicated method covers. Example: .set("subscription", "monthly").

Generic page · EaGeneric

Use it on every page that is not a product, cart, order or quote page, including the homepage and the intermediate funnel steps. It reports site-centric traffic, page views, visits and natural sources.

Methods:

  • new EaGeneric.Builder(path), page name (mandatory)
  • setUID(uid), internal ID of the logged-in user; consolidates cross-device history
  • setEmail(email), the user’s email, hashed as lower-case hexadecimal SHA-256
  • setProfile(profile), the user’s profile (e.g. visitor, buyer, looker)
  • setPageGroup(group), page group for reporting
  • setLocation(lat, lon), the device’s GPS coordinates
  • setNewCustomer(boolean), true if this is a new customer
  • set(key, value), free custom parameter
  • setAction(action), attaches an action, replacing the previous one
  • putAction(action), accumulates several actions on the same tag
  • setProperty(property), site-centric property (SiteCentricProperty)
  • setCFlag(cflag), context flag (SiteCentricCFlag)
  • setStandalone(), the hit does not count as a page view in Eulerian

Example:

import EaGeneric from './src/models/eaGeneric';

const props = new EaGeneric.Builder("home|landing")
  .setUID("123asd")
  .setEmail("test@test.com")
  .setProfile("visitor")
  .setPageGroup("MY-PAGEGROUP")
  .set("subscription", "monthly")
  .build();

EAnalytics.track(props);

Product page · EAProducts (1 product)

Reports product page views and feeds the “Acquisition & Product Performance” report. A tag is treated as a product page when it contains exactly one product.

Product methods:

  • new Product.Builder(ref), product reference (mandatory)
  • setName(name), readable product name for reporting
  • setGroup(group), margin group (A or B)
  • setParams(params), product categories (e.g. prdparam-category, prdparam-brand)

Params methods:

  • new Params.Builder(), constructor
  • addParam(key, value), adds a key/value pair, string or number

Example:

import EAProducts from './src/models/eaProducts';
import Product from './src/models/classes/product';
import Params from './src/models/classes/params';

const params = new Params.Builder()
  .addParam("category", "clothes")
  .addParam("brand", "nike")
  .build();

const product = new Product.Builder("ref-product")
  .setName("name-product")
  .setGroup("A")
  .setParams(params)
  .build();

const page = new EAProducts.Builder("product|detail")
  .setUID("123asd")
  .setEmail("test@test.com")
  .setProfile("looker")
  .addProduct(product)
  .build();

EAnalytics.track(page);

Category page · EAProducts (N products)

Reports the N references shown on a results or category page. A tag is treated as a category page when it contains more than one product. The class is the same, with several calls to .addProduct().

Example:

import EAProducts from './src/models/eaProducts';
import Product from './src/models/classes/product';

const product1 = new Product.Builder("ref-product1").setName("Product 1").build();
const product2 = new Product.Builder("ref-product2").setName("Product 2").build();
const product3 = new Product.Builder("ref-product3").setName("Product 3").build();

const page = new EAProducts.Builder("category|shoes")
  .setUID("123asd")
  .setEmail("test@test.com")
  .setPageGroup("my-pagegroup")
  .addProduct(product1)
  .addProduct(product2)
  .addProduct(product3)
  .build();

EAnalytics.track(page);

Search engine page · EASearch

Reports internal search engine queries, the number of results and search parameters.

Methods:

  • new EASearch.Builder(path), page name (mandatory)
  • setName(name), search engine name (mandatory)
  • setResults(count), number of results returned
  • setParams(params), search parameters, which feed isearchkey and isearchdata
  • setUID(uid), internal ID of the user
  • set(key, value), free custom parameter

Example:

import EASearch from './src/models/eaSearch';
import Params from './src/models/classes/params';

const searchParams = new Params.Builder()
  .addParam("keyword", "jacket")
  .addParam("price_min", "100.00")
  .addParam("price_max", "400.00")
  .build();

const page = new EASearch.Builder("internal_search|jacket")
  .setUID("34678")
  .setName("internal_search")
  .setResults(150)
  .setParams(searchParams)
  .build();

EAnalytics.track(page);

404 error page · EaGeneric

Flag a 404 page by adding .set("error", "1") to an EaGeneric tag. It feeds the error pages report.

import EaGeneric from './src/models/eaGeneric';

const props = new EaGeneric.Builder("error|404")
  .set("error", "1")
  .build();

EAnalytics.track(props);

Quote page · EAEstimate

Reports quotes and the products attached to them. Quotes are deduplicated by reference: a second call carrying the same ref is ignored.

Methods:

  • new EAEstimate.Builder(path), page name (mandatory)
  • setRef(ref), unique quote reference (mandatory)
  • setAmount(amount), total amount including tax, with a point as the decimal separator
  • setType(type), quote type according to your own taxonomy
  • setCurrency(currency), currency, if it differs from the one configured in the interface
  • addProduct(product, amount, quantity), adds a product with its unit amount and quantity
  • setUID(uid), internal ID of the user
  • setEmail(email), the user’s email, hashed as lower-case hexadecimal SHA-256
  • set(key, value), free custom parameter

Example:

import EAEstimate from './src/models/eaEstimate';
import Product from './src/models/classes/product';
import CurrencyISO from './src/utils/currencyISO';

const product = new Product.Builder("505").setName("Estimate product").build();

const page = new EAEstimate.Builder("credit|quote")
  .setRef("C4536567")
  .setUID("123asd")
  .setEmail("test@test.com")
  .setAmount(5000.00)
  .setType("credit_48months")
  .setCurrency(CurrencyISO.EUR)
  .set("custom-param-key", "custom-value")
  .addProduct(product, 5000.00, 1)
  .build();

EAnalytics.track(page);

Cart page · EACart

Reports started carts and makes it possible to calculate conversion and abandonment rates. A cart session lasts a rolling 30 minutes.

Methods:

  • new EACart.Builder(path), page name (mandatory)
  • setCartCumul(boolean), false: the tag’s products represent the whole cart, as a snapshot; true: products accumulate from one call to the next
  • addProduct(product, amount, quantity), adds a product with its unit amount and quantity
  • setUID(uid), internal ID of the user
  • setEmail(email), the user’s email, hashed as lower-case hexadecimal SHA-256
  • setProfile(profile), the user’s profile
  • setPageGroup(group), page group
  • set(key, value), free custom parameter

Example:

import EACart from './src/models/eaCart';
import Product from './src/models/classes/product';
import Params from './src/models/classes/params';

const params = new Params.Builder()
  .addParam("category", "T-Shirt")
  .addParam("brand", "Nike")
  .build();

const product = new Product.Builder("product-123")
  .setName("product-name")
  .setParams(params)
  .build();

const page = new EACart.Builder("cart")
  .setUID("123asd")
  .setEmail("test@test.com")
  .setProfile("shopper")
  .setPageGroup("my-page-group")
  .setCartCumul(false)
  .addProduct(product, 50.30, 2)
  .build();

EAnalytics.track(page);

Order page · EAOrder

Reports conversions and ROI. Orders are deduplicated by reference. Place this tag as early as possible in the payment funnel, so you do not lose it if the user never comes back to the app after the payment platform.

Methods:

  • new EAOrder.Builder(path), page name (mandatory)
  • setRef(ref), unique order reference (mandatory)
  • setAmount(amount), total amount including tax, excluding shipping (mandatory)
  • setPayment(payment), payment method used (e.g. credit card, paypal)
  • setType(type), sale type according to your own taxonomy
  • setCurrency(currency), currency, if it differs from the one configured in the interface
  • setNewCustomer(boolean), true: new buyer; false: known customer
  • setEstimateRef(estimateRef), reference of the quote linked to this order
  • addProduct(product, amount, quantity), adds a product with its unit amount and quantity
  • setUID(uid), internal ID of the user
  • setEmail(email), the user’s email, hashed as lower-case hexadecimal SHA-256
  • setProfile(profile), the user’s profile
  • set(key, value), free custom parameter

Example:

import EAOrder from './src/models/eaOrder';
import Product from './src/models/classes/product';
import Params from './src/models/classes/params';
import CurrencyISO from './src/utils/currencyISO';

const params = new Params.Builder()
  .addParam("category", "T-Shirt")
  .addParam("brand", "Nike")
  .build();

const product = new Product.Builder("product-123")
  .setName("product-name")
  .setParams(params)
  .build();

const page = new EAOrder.Builder("funnel|confirmation")
  .setRef("F654335671")
  .setUID("123asd")
  .setEmail("test@test.com")
  .setProfile("buyer")
  .setNewCustomer(true)
  .setAmount(50.30)
  .setType("online")
  .setPayment("credit card")
  .setCurrency(CurrencyISO.EUR)
  .set("custom-param-key", "custom-value")
  .addProduct(product, 25.15, 2)
  .build();

EAnalytics.track(page);

Merchandising tracking · EATpView / EATpClick

Reports impressions and clicks on merchandising blocks: recommendation lists, banners and so on. These two tags go out as GET to /tpview/ and /tpclick/, where the others go out as POST, and they benefit from the same offline resending mechanism.

EATpView methods, for the impression:

  • new EATpView.Builder(path), reference page (mandatory)
  • setSiteName(name), name of the merchant site
  • setCampaign(campaign), campaign name
  • setPlacement(placement), position of the block on the page
  • addProduct(ref, position?), product reference and its position in the block, to repeat for each product shown
  • setUrl(url), context URL
  • setPublisher(publisher), publisher, optional
  • setMedia(media), media type, optional
  • setCategory(category), block category, optional

EATpClick methods, for the click:

  • new EATpClick.Builder(path), reference page (mandatory)
  • setSiteName(name), name of the merchant site
  • setCampaign(campaign), campaign name
  • setPlacement(placement), position of the block on the page
  • setProduct(ref, position, totalProducts?), reference and position of the clicked product (mandatory), with the total number of products in the block as an optional third parameter
  • setUrl(url), context URL
  • setPublisher(publisher), publisher, optional
  • setMedia(media), media type, optional
  • setCategory(category), block category, optional

Example:

import { EATpView, EATpClick } from './src/models/eaMerchandising';

// Impression of a merchandising block
const view = new EATpView.Builder("homepage")
  .setSiteName("my-site")
  .setCampaign("summer_sale")
  .setPlacement("banner_top")
  .addProduct("PROD_001", 0)
  .addProduct("PROD_002", 1)
  .setUrl("https://www.example.com")
  .build();

EAnalytics.track(view);

// Click on a product in that block
const click = new EATpClick.Builder("homepage")
  .setSiteName("my-site")
  .setCampaign("summer_sale")
  .setPlacement("banner_top")
  .setProduct("PROD_001", 0)
  .setUrl("https://www.example.com")
  .build();

EAnalytics.track(click);

Actions · Action

Actions let you track interactions outside a standard page view: sign-up funnels, surveys, moving between sections. An action is attached to any tag with setAction(), which replaces the previous action, or putAction(), which accumulates several on the same tag.

To send an action with no associated page view, call setStandalone() on the tag: the hit will not count as a page view in Eulerian.

Methods:

  • new Action.Builder(), constructor
  • setName(name), action name (mandatory)
  • setMode(mode), direction of the action: "in" on entry, "out" on exit, or "neat"
  • setLabel(label), action label
  • setReference(ref), reference identifying the action in your systems
  • setParams(params), extra key/value parameters

Action attached to a page view:

import EaGeneric from './src/models/eaGeneric';
import Action from './src/models/classes/action';

const action1 = new Action.Builder()
  .setName("subscription-step1")
  .setMode("in")
  .setLabel("premium-offer")
  .build();

const action2 = new Action.Builder()
  .setName("subscription-step1")
  .setMode("out")
  .setLabel("abandoned")
  .build();

const props = new EaGeneric.Builder("subscription|step1")
  .setUID("123asd")
  .putAction(action1)
  .putAction(action2)
  .build();

EAnalytics.track(props);

Standalone action, with no page view:

The path becomes optional with setStandalone(): the Builder accepts new EaGeneric.Builder() with no argument.

import EaGeneric from './src/models/eaGeneric';
import Action from './src/models/classes/action';
import Params from './src/models/classes/params';

const action = new Action.Builder()
  .setName("cta-click")
  .setMode("in")
  .setLabel("hero-banner")
  .setParams(new Params.Builder()
    .addParam("origin", "martinique")
    .build())
  .build();

const props = new EaGeneric.Builder()  // path omitted in standalone mode
  .setStandalone()   // does not count as a page view
  .setUID("123asd")
  .putAction(action)
  .build();

EAnalytics.track(props);

Site-centric property · SiteCentricProperty

Attaches site-centric product properties to any tag. The API is the same as SiteCentricCFlag’s, but it feeds the property field instead of cflag.

Methods:

  • new SiteCentricProperty.Builder(), constructor
  • set(key, ...values), defines a property dimension with one or more values

Example:

import EaGeneric from './src/models/eaGeneric';
import SiteCentricProperty from './src/models/classes/siteCentricProperty';

const property = new SiteCentricProperty.Builder()
  .set("universe", "fish", "meat")
  .set("type", "fresh")
  .build();

const props = new EaGeneric.Builder("home|landing")
  .setUID("123asd")
  .setProperty(property)
  .build();

EAnalytics.track(props);

Context Flag (CFLAG) · SiteCentricCFlag

Attaches one or more context flags to any tag, to enrich your reports with contextual dimensions. Each flag accepts several values.

Methods:

  • new SiteCentricCFlag.Builder(), constructor
  • set(key, ...values), defines a contextual dimension with one or more values

Example:

import EaGeneric from './src/models/eaGeneric';
import SiteCentricCFlag from './src/models/classes/siteCentricCFlag';

const cflag = new SiteCentricCFlag.Builder()
  .set("category_1", "rolandgarros", "wimbledon")
  .set("category_2", "tennis")
  .set("category_3", "usopen")
  .build();

const props = new EaGeneric.Builder("home|landing")
  .setUID("123asd")
  .setEmail("email@test.com")
  .setCFlag(cflag)
  .build();

EAnalytics.track(props);

WebView tracking

For hybrid apps that open a WebView, pass the SDK’s internal identifier in the opening URL so that tracking carries on between the native app and the web session. Also add the edev parameter, which flags the traffic as native.

The ea-euidl-bypass parameter must carry the persistent device identifier, the one the SDK includes in every hit, not the advertising identifier. The React Native SDK has no dedicated getEuidl() method: read the value directly from react-native-device-info.

  • Android, Android ID (ea-android-id, or euidl in the SDK): DeviceInfo.getAndroidId()
  • iOS, IDFV (ea-ios-idfv in the SDK): DeviceInfo.getUniqueId()

EAnalytics.getAdInfoId() returns the advertising identifier (IDFA or GAID). It is a different identifier, and it must not be used for ea-euidl-bypass.

import { Platform } from 'react-native';
import DeviceInfo from 'react-native-device-info';

const euidl = Platform.OS === 'android'
  ? await DeviceInfo.getAndroidId()
  : await DeviceInfo.getUniqueId();

// Build the URL with the required parameters
const baseUrl = "https://www.example.com/landing";
const edev = Platform.OS === 'android' ? "AppNativeAndroidphone" : "AppNativeIOSphone";
const webViewUrl = `${baseUrl}?ea-euidl-bypass=${encodeURIComponent(euidl)}&edev=${edev}`;

// Load it in the WebView
<WebView source={{ uri: webViewUrl }} />

Accepted values for edev:

ValueDevice
AppNativeIOSphoneiPhone
AppNativeIOStabletiPad
AppNativeAndroidphoneAndroid phone
AppNativeAndroidtabletAndroid tablet

ea-euidl-bypass must be present on every URL change in the WebView, otherwise the link between app and web browsing is lost.

App metrics

Downloads and updates are tracked with three parameters, present in the first tag sent at launch.

ParameterValueDescription
ea-appnameApp nameApp identifier (must never change), collected automatically by the SDK
ea-appversionVersion stringCurrent version, collected automatically by the SDK
ea-appinstalled1To pass manually if the app existed before the Eulerian integration

The first two are collected automatically on every hit through react-native-device-info. Nothing is needed on your side, except passing ea-appinstalled during a migration.

The logic the system applies:

  • the Download metric is incremented when ea-appname is seen for the first time for this user, without ea-appinstalled;
  • the Update metric is incremented when ea-appname is unchanged but ea-appversion carries a new value compared with the last launch.

Migration, for an app that existed before Eulerian:

import EaGeneric from './src/models/eaGeneric';

const props = new EaGeneric.Builder("home|landing")
  .set("ea-appinstalled", "1")
  .build();

EAnalytics.track(props);

The two modes below are mutually exclusive. Choose one, and never use both in the same app.

Pass the TCString generated by your CMP once per visitor, at the moment the user opts in or out.

import EaGeneric from './src/models/eaGeneric';

const props = new EaGeneric.Builder("universe|section|page")
  .setUID("5434742")
  .set("subscription", "monthly")
  .set("gdpr_consent", "EADURF214345") // your TCString
  .build();

EAnalytics.track(props);

Mode 2 · Categories (pmcat)

Pass the Eulerian identifiers of the refused categories, separated by -. Send - on its own if the user accepts everything.

import EaGeneric from './src/models/eaGeneric';

const props = new EaGeneric.Builder("universe|section|page")
  .setUID("5434742")
  .set("subscription", "monthly")
  .set("pmcat", "1-10") // IDs of the refused categories
  .build();

EAnalytics.track(props);

Example category mapping:

CategoryEulerian ID
analytics1
advertising10
functional19

A user who refuses analytics and advertising therefore gives pmcat = 1-10.

Summary:

TCF v2 modeCategories mode
Parametergdpr_consentpmcat
Whenat opt-in or opt-outat opt-in or opt-out
Contentthe TCStringthe refused IDs, or -
Compatible CMPTCF v2 CMPCustom CMP, outside TCF

Platform notes

Android TV: PersistentIdentity.getAdvertisingId() is not supported on Android TV and does not return the device’s advertising identifier, because of a limitation of the React Native platform.

iOS, IDFA: the SDK collects the IDFA automatically if the user has given consent through ATTrackingManager. No extra configuration is needed on the SDK side, beyond declaring NSUserTrackingUsageDescription in the Info.plist.

Android, advertising identifier: the SDK collects the GAID automatically through @sparkfabrik/react-native-idfa-aaid. If the user has turned on “Opt out of Ads Personalisation”, the LAT flag (ea-android-islat) is true.