Skip to content

About

iOS tracking library for Eulerian Technologies Analytics.

Resources

Stars

3 stars

Watchers

6 watching

Forks

Repository files navigation

iOS SDK — Eulerian Analytics

Complete installation and tagging guide for the Eulerian Analytics iOS SDK.


Table of contents


Installation

CocoaPods

If you don't have CocoaPods yet, install it:

sudo gem install cocoapods

If your project doesn't have a Podfile yet, initialise one at the project root:

pod init

Add the dependency to your Podfile:

pod 'EAnalytics'

Then run:

pod install

Open your project using the .xcworkspace file generated by CocoaPods (not the .xcodeproj).

Swift Package Manager

In Xcode, go to File → Add Package Dependencies and enter the Eulerian iOS GitHub repository URL. Or add it directly to Package.swift:

dependencies: [
    .package(url: "https://github.com/EulerianTechnologies/eulerian-sdk-ios", from: "1.5.0")
]

Supported platforms: iOS 9.0+ (CocoaPods) / iOS 11.0+ (SPM) · tvOS 9.0+


Initialization

Initialise the SDK once in application(_:didFinishLaunchingWithOptions:). The SDK is a singleton — a second call to initWithHost is silently ignored.

Swift

import EAnalytics

@main
class AppDelegate: UIResponder, UIApplicationDelegate {

    func application(_ application: UIApplication,
                     didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Replace with your tracking subdomain
        EAnalytics.initWithHost("example.demo.com", andWithDebugLogs: false)
        return true
    }
}

Objective-C

#import <EAnalytics/EAnalytics.h>

- (BOOL)application:(UIApplication *)application
    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [EAnalytics initWithHost:@"example.demo.com" andWithDebugLogs:NO];
    return YES;
}

The second parameter enables (true) or disables (false) debug logs in the Xcode console.

Tracking subdomain: the value to pass is provided by your Eulerian team. It looks like example.demo.com — do not include https:// or /. The SDK rejects hosts containing .eulerian.com.

Traffic attribution in Eulerian: a native app has no URL. The SDK automatically uses the app name (ea-appname) as an internal identifier, and the subdomain passed to initWithHost to attribute traffic to the correct site in the Eulerian interface.

If several apps share the same tracking subdomain, use the from parameter via setEulerianWithValue(_:forKey:) to distinguish them.

EUIDL: the SDK automatically generates and persists a unique identifier per installation (euidl). It is stored in NSUserDefaults and survives app updates. Accessible via EAnalytics.euidl().

Offline & retry: if the device has no connection when track is called, the tag is serialised locally and automatically resent on the next track call or the next app launch. The actual timestamp of the interaction is preserved (ereplay-time).


Tag types

path (page name) is mandatory on every tag. It is never retrieved automatically — unlike the web where the URL identifies the page. Use a hierarchical convention with | as a separator, for example "home|main", "catalogue|shoes|men", "funnel|payment|confirmation". The value is free but must be stable and meaningful for reporting.

Generic method setEulerianWithValue(_:forKey:): available on all tags, it lets you add any custom parameter not covered by the dedicated methods. Example: setEulerianWithValue("monthly", forKey: "subscription").


Generic page — EAProperties

Use on all pages that are not product pages, cart, order or estimate pages (including the homepage and intermediate steps in the conversion funnel). Reports site-centric traffic, page views, visits and organic sources.

Methods:

  • initWithPath(_ path: String) — page name (mandatory)
  • setEulerianWithUid(_ value: String) — internal ID of the logged-in user; consolidates multi-device history
  • setEulerianWithEmail(_ value: String) — user's email address
  • setEulerianWithProfile(_ value: String) — user profile (e.g. visitor, buyer, looker)
  • setEulerianWithPageGroup(_ value: String) — page group for reporting
  • setEulerianWithValue(_ value: Any, forKey key: String) — free custom parameter
  • setEulerianWithCFlag(_ value: EAOSiteCentricCFlag) — attaches one or more context flags (see Context Flag)

Swift

let props = EAProperties(path: "home|main")
props.setEulerianWithUid("123asd")
props.setEulerianWithEmail("test@test.com")
props.setEulerianWithProfile("visitor")
props.setEulerianWithPageGroup("MY-PAGEGROUP")
props.setEulerianWithValue("value", forKey: "KEY-CUSTOM-PARAM")
EAnalytics.track(props)

Objective-C

EAProperties *props = [[EAProperties alloc] initWithPath:@"home|main"];
[props setEulerianWithUid:@"123asd"];
[props setEulerianWithEmail:@"test@test.com"];
[props setEulerianWithProfile:@"visitor"];
[props setEulerianWithPageGroup:@"MY-PAGEGROUP"];
[props setEulerianWithValue:@"value" forKey:@"KEY-CUSTOM-PARAM"];
[EAnalytics track:props];

Product page — EAProducts (1 product)

Tracks product page views and feeds the "Product Acquisition & Performance" report. A tag is considered a product page when it contains exactly one product and none of the parameters scart, estimate, ref, amount.

Methods:

  • initWithPath(_ path: String) — page name (mandatory)
  • setEulerianWithProducts(_ products: [EAOProduct]) — array containing the product (mandatory)
  • setEulerianWithUid(_ value: String) — internal user ID
  • setEulerianWithEmail(_ value: String) — user's email address
  • setEulerianWithProfile(_ value: String) — user profile
  • setEulerianWithPageGroup(_ value: String) — page group
  • setEulerianWithValue(_ value: Any, forKey key: String) — free custom parameter

Building an EAOProduct:

  • initWithRef(_ ref: String) — product reference (mandatory)
  • setEulerianWithName(_ value: String) — human-readable product name for reporting
  • setEulerianWithGroup(_ value: String) — margin group (A or B)
  • setEulerianWithParams(_ value: EAOParams) — product categories (e.g. prdparam-category, prdparam-brand)

Building an EAOParams:

  • setEulerianWithStringValue(_ value: String, forKey key: String) — product category; the key is the suffix after prdparam-
  • setEulerianWithIntValue(_ value: Int32, forKey key: String) — integer value

Swift

let params = EAOParams()
params.setEulerianWithStringValue("clothes", forKey: "category") // prdparam-category
params.setEulerianWithStringValue("nike", forKey: "brand")       // prdparam-brand

let product = EAOProduct(ref: "ref-product")
product.setEulerianWithName("name-product")
product.setEulerianWithGroup("A")
product.setEulerianWithParams(params)

let page = EAProducts(path: "product|detail")
page.setEulerianWithUid("123asd")
page.setEulerianWithEmail("test@test.com")
page.setEulerianWithProfile("looker")
page.setEulerianWithProducts([product])
EAnalytics.track(page)

Objective-C

EAOParams *params = [[EAOParams alloc] init];
[params setEulerianWithStringValue:@"clothes" forKey:@"category"];
[params setEulerianWithStringValue:@"nike" forKey:@"brand"];

EAOProduct *product = [[EAOProduct alloc] initWithRef:@"ref-product"];
[product setEulerianWithName:@"name-product"];
[product setEulerianWithGroup:@"A"];
[product setEulerianWithParams:params];

EAProducts *page = [[EAProducts alloc] initWithPath:@"product|detail"];
[page setEulerianWithUid:@"123asd"];
[page setEulerianWithEmail:@"test@test.com"];
[page setEulerianWithProfile:@"looker"];
[page setEulerianWithProducts:@[product]];
[EAnalytics track:page];

Category page — EAProducts (N products)

Sends the first N product references shown on a results or category page. A tag is considered a category page when it contains more than one product and none of the parameters scart, estimate, ref, amount.

Use the same EAProducts class, passing an array with multiple products.

Swift

let product1 = EAOProduct(ref: "ref-product1")
let product2 = EAOProduct(ref: "ref-product2")
let product3 = EAOProduct(ref: "ref-product3")

let page = EAProducts(path: "category|shoes")
page.setEulerianWithUid("123asd")
page.setEulerianWithEmail("test@test.com")
page.setEulerianWithPageGroup("my-pagegroup")
page.setEulerianWithProducts([product1, product2, product3])
EAnalytics.track(page)

Objective-C

EAOProduct *product1 = [[EAOProduct alloc] initWithRef:@"ref-product1"];
EAOProduct *product2 = [[EAOProduct alloc] initWithRef:@"ref-product2"];
EAOProduct *product3 = [[EAOProduct alloc] initWithRef:@"ref-product3"];

EAProducts *page = [[EAProducts alloc] initWithPath:@"category|shoes"];
[page setEulerianWithUid:@"123asd"];
[page setEulerianWithEmail:@"test@test.com"];
[page setEulerianWithPageGroup:@"my-pagegroup"];
[page setEulerianWithProducts:@[product1, product2, product3]];
[EAnalytics track:page];

Search engine page — EASearch

Tracks internal search engine queries, result counts and search parameters. A tag is considered a search engine page when it contains isearchengine. Non-exclusive: can be combined with a product on the same tag.

Methods:

  • initWithPath(_ path: String, withName name: String) — page name + engine name (mandatory)
  • setEulerianWithResults(_ value: Int32) — number of results returned
  • setEulerianWithParams(_ value: EAOParams) — search parameters (key/value pairs mapping to isearchkey/isearchdata)
  • setEulerianWithUid(_ value: String) — internal user ID
  • setEulerianWithValue(_ value: Any, forKey key: String) — free custom parameter

Swift

let searchParams = EAOParams()
searchParams.setEulerianWithStringValue("jacket", forKey: "keyword")
searchParams.setEulerianWithStringValue("100.00", forKey: "price_min")
searchParams.setEulerianWithStringValue("400.00", forKey: "price_max")

let page = EASearch(path: "internal_search|jacket", withName: "internal_search")
page.setEulerianWithUid("34678")
page.setEulerianWithResults(150)
page.setEulerianWithParams(searchParams)
EAnalytics.track(page)

Objective-C

EAOParams *searchParams = [[EAOParams alloc] init];
[searchParams setEulerianWithStringValue:@"jacket" forKey:@"keyword"];
[searchParams setEulerianWithStringValue:@"100.00" forKey:@"price_min"];
[searchParams setEulerianWithStringValue:@"400.00" forKey:@"price_max"];

EASearch *page = [[EASearch alloc] initWithPath:@"internal_search|jacket" withName:@"internal_search"];
[page setEulerianWithUid:@"34678"];
[page setEulerianWithResults:150];
[page setEulerianWithParams:searchParams];
[EAnalytics track:page];

404 error page — EAProperties

Flag a 404 error page by adding setEulerianWithValue("1", forKey: "error") to an EAProperties tag. Feeds the "Error pages" report.

Swift

let props = EAProperties(path: "error|404")
props.setEulerianWithValue("1", forKey: "error")
EAnalytics.track(props)

Objective-C

EAProperties *props = [[EAProperties alloc] initWithPath:@"error|404"];
[props setEulerianWithValue:@"1" forKey:@"error"];
[EAnalytics track:props];

Estimate page — EAEstimate

Tracks estimates and their associated products. Estimates are deduplicated by reference: a second call with the same reference is ignored.

Methods:

  • initWithPath(_ path: String, withRef ref: String) — page name + unique estimate reference (mandatory)
  • setEulerianWithAmount(_ value: Double) — total VAT-inclusive amount (decimal separator: period)
  • setEulerianWithType(_ value: String) — estimate type according to your own taxonomy
  • setEulerianWithCurrency(_ value: String) — currency if different from the one configured in the interface
  • addEulerian(_ product: EAOProduct, amount: Double, quantity: Int32) — adds a product with its unit amount and quantity
  • setEulerianWithUid(_ value: String) — internal user ID
  • setEulerianWithEmail(_ value: String) — user's email address
  • setEulerianWithValue(_ value: Any, forKey key: String) — free custom parameter

Swift

let product = EAOProduct(ref: "505")

let page = EAEstimate(path: "credit|estimate", withRef: "C4536567")
page.setEulerianWithUid("123asd")
page.setEulerianWithEmail("test@test.com")
page.setEulerianWithAmount(5000.00)
page.setEulerianWithType("credit_48months")
page.setEulerianWithCurrency("EUR")
page.setEulerianWithValue("custom-value", forKey: "custom-param-key")
page.addEulerian(product, amount: 5000.00, quantity: 1)
EAnalytics.track(page)

Objective-C

EAOProduct *product = [[EAOProduct alloc] initWithRef:@"505"];

EAEstimate *page = [[EAEstimate alloc] initWithPath:@"credit|estimate" withRef:@"C4536567"];
[page setEulerianWithUid:@"123asd"];
[page setEulerianWithEmail:@"test@test.com"];
[page setEulerianWithAmount:5000.00];
[page setEulerianWithType:@"credit_48months"];
[page setEulerianWithCurrency:@"EUR"];
[page setEulerianWithValue:@"custom-value" forKey:@"custom-param-key"];
[page addEulerian:product amount:5000.00 quantity:1];
[EAnalytics track:page];

Cart page — EACart

Tracks initiated carts and enables conversion and abandonment rate calculations. A tag is considered a cart page when it contains the scart parameter, set automatically by the EACart class. Cart lifetime: 30 rolling minutes.

Methods:

  • initWithPath(_ path: String) — page name (mandatory)
  • setEulerianWithCumul(_ value: Bool) — false: the products in the tag represent the entire cart (snapshot); true: products accumulate across successive calls
  • addEulerian(_ product: EAOProduct, amount: Double, quantity: Int32) — adds a product with its unit amount and quantity
  • setEulerianWithUid(_ value: String) — internal user ID
  • setEulerianWithEmail(_ value: String) — user's email address
  • setEulerianWithProfile(_ value: String) — user profile
  • setEulerianWithPageGroup(_ value: String) — page group
  • setEulerianWithValue(_ value: Any, forKey key: String) — free custom parameter

Swift

let params = EAOParams()
params.setEulerianWithStringValue("T-Shirt", forKey: "category")
params.setEulerianWithStringValue("Nike", forKey: "brand")

let product = EAOProduct(ref: "product-123")
product.setEulerianWithName("product-name")
product.setEulerianWithParams(params)

let page = EACart(path: "cart")
page.setEulerianWithUid("123asd")
page.setEulerianWithEmail("test@test.com")
page.setEulerianWithProfile("shopper")
page.setEulerianWithPageGroup("my-page-group")
page.setEulerianWithCumul(false)
page.addEulerian(product, amount: 50.30, quantity: 2)
EAnalytics.track(page)

Objective-C

EAOParams *params = [[EAOParams alloc] init];
[params setEulerianWithStringValue:@"T-Shirt" forKey:@"category"];
[params setEulerianWithStringValue:@"Nike" forKey:@"brand"];

EAOProduct *product = [[EAOProduct alloc] initWithRef:@"product-123"];
[product setEulerianWithName:@"product-name"];
[product setEulerianWithParams:params];

EACart *page = [[EACart alloc] initWithPath:@"cart"];
[page setEulerianWithUid:@"123asd"];
[page setEulerianWithEmail:@"test@test.com"];
[page setEulerianWithProfile:@"shopper"];
[page setEulerianWithPageGroup:@"my-page-group"];
[page setEulerianWithCumul:NO];
[page addEulerian:product amount:50.30 quantity:2];
[EAnalytics track:page];

Order page — EAOrder

Tracks conversions and ROI. Orders are deduplicated by reference. Implement this tag as early as possible in the payment funnel so it is not missed if the user does not return to the app after the payment platform.

Methods:

  • initWithPath(_ path: String, withRef ref: String) — page name + unique order reference (mandatory)
  • setEulerianWithAmount(_ value: Double) — total VAT-inclusive amount excluding shipping (mandatory)
  • setEulerianWithPayment(_ value: String) — payment method used (e.g. credit card, paypal)
  • setEulerianWithType(_ value: String) — sale type according to your own taxonomy
  • setEulerianWithCurrency(_ value: String) — currency if different from the one configured in the interface
  • setEulerianWithNewCustomer(_ value: Bool) — true: new buyer; false: returning customer
  • setEulerianWithEstimateRef(_ value: String) — reference of the estimate linked to this order (optional)
  • addEulerian(_ product: EAOProduct, amount: Double, quantity: Int32) — adds a product with its unit amount and quantity
  • setEulerianWithUid(_ value: String) — internal user ID
  • setEulerianWithEmail(_ value: String) — user's email address
  • setEulerianWithProfile(_ value: String) — user profile
  • setEulerianWithValue(_ value: Any, forKey key: String) — free custom parameter

Swift

let params = EAOParams()
params.setEulerianWithStringValue("T-Shirt", forKey: "category")
params.setEulerianWithStringValue("Nike", forKey: "brand")

let product = EAOProduct(ref: "product-123")
product.setEulerianWithName("product-name")
product.setEulerianWithParams(params)

let page = EAOrder(path: "funnel|confirmation", withRef: "F654335671")
page.setEulerianWithUid("123asd")
page.setEulerianWithEmail("test@test.com")
page.setEulerianWithProfile("buyer")
page.setEulerianWithNewCustomer(true)
page.setEulerianWithAmount(50.30)
page.setEulerianWithType("online")
page.setEulerianWithPayment("credit card")
page.setEulerianWithCurrency("EUR")
page.setEulerianWithEstimateRef("asd123qwe")
page.setEulerianWithValue("custom-value", forKey: "custom-param-key")
page.addEulerian(product, amount: 25.15, quantity: 2)
EAnalytics.track(page)

Objective-C

EAOParams *params = [[EAOParams alloc] init];
[params setEulerianWithStringValue:@"T-Shirt" forKey:@"category"];
[params setEulerianWithStringValue:@"Nike" forKey:@"brand"];

EAOProduct *product = [[EAOProduct alloc] initWithRef:@"product-123"];
[product setEulerianWithName:@"product-name"];
[product setEulerianWithParams:params];

EAOrder *page = [[EAOrder alloc] initWithPath:@"funnel|confirmation" withRef:@"F654335671"];
[page setEulerianWithUid:@"123asd"];
[page setEulerianWithEmail:@"test@test.com"];
[page setEulerianWithProfile:@"buyer"];
[page setEulerianWithNewCustomer:YES];
[page setEulerianWithAmount:50.30];
[page setEulerianWithType:@"online"];
[page setEulerianWithPayment:@"credit card"];
[page setEulerianWithCurrency:@"EUR"];
[page setEulerianWithEstimateRef:@"asd123qwe"];
[page setEulerianWithValue:@"custom-value" forKey:@"custom-param-key"];
[page addEulerian:product amount:25.15 quantity:2];
[EAnalytics track:page];

Merchandise tracking — EATpView / EATpClick

Tracks impressions and clicks on merchandise blocks (recommendation lists, banners, etc.). Sent as GET requests to /tpview/ and /tpclick/ — unlike other tags which are sent via POST. Supports the same offline retry mechanism as the rest of the SDK.

EATpView methods (impression):

  • initWithPath(_ path: String) — reference page (mandatory)
  • setSiteName(_ value: String) — merchant site name
  • setCampaign(_ value: String) — campaign name
  • setPlacement(_ value: String) — block position within the page
  • addProductWithRef(_ ref: String, position: NSNumber) — product reference and its position in the block; repeat for each displayed product
  • setUrl(_ value: String) — context URL
  • setPublisher(_ value: String) — publisher (optional)
  • setMedia(_ value: String) — media type (optional)
  • setCategory(_ value: String) — block category (optional)

EATpClick methods (click):

  • initWithPath(_ path: String) — reference page (mandatory)
  • setSiteName(_ value: String) — merchant site name
  • setCampaign(_ value: String) — campaign name
  • setPlacement(_ value: String) — block position within the page
  • setProductWithRef(_ ref: String, position: Int) — reference and position of the clicked product (mandatory)
  • setProductWithRef(_ ref: String, position: Int, totalProducts: NSNumber) — variant with the total number of products in the block
  • setUrl(_ value: String) — context URL
  • setPublisher(_ value: String) — publisher (optional)
  • setMedia(_ value: String) — media type (optional)
  • setCategory(_ value: String) — block category (optional)

Swift

// Impression on a merchandise block
let view = EATpView(path: "homepage")
view.setSiteName("my-site")
view.setCampaign("summer_sale")
view.setPlacement("banner_top")
view.addProductWithRef("PROD_001", position: NSNumber(value: 0))
view.addProductWithRef("PROD_002", position: NSNumber(value: 1))
view.setUrl("https://www.example.com")
EAnalytics.track(view)

// Click on a product within the block
let click = EATpClick(path: "homepage")
click.setSiteName("my-site")
click.setCampaign("summer_sale")
click.setPlacement("banner_top")
click.setProductWithRef("PROD_001", position: 0)
click.setUrl("https://www.example.com")
EAnalytics.track(click)

Objective-C

// Impression
EATpView *view = [[EATpView alloc] initWithPath:@"homepage"];
[view setSiteName:@"my-site"];
[view setCampaign:@"summer_sale"];
[view setPlacement:@"banner_top"];
[view addProductWithRef:@"PROD_001" position:@(0)];
[view addProductWithRef:@"PROD_002" position:@(1)];
[view setUrl:@"https://www.example.com"];
[EAnalytics track:view];

// Click
EATpClick *click = [[EATpClick alloc] initWithPath:@"homepage"];
[click setSiteName:@"my-site"];
[click setCampaign:@"summer_sale"];
[click setPlacement:@"banner_top"];
[click setProductWithRef:@"PROD_001" position:2];
[click setUrl:@"https://www.example.com"];
[EAnalytics track:click];

Actions — EAOAction

Actions let you track user interactions (subscription funnel, questionnaire, cross-section navigation, etc.) outside of classic page views. An action can be attached to any tag via setEulerianWithAction: (replaces any previous action) or addEulerianWithAction: (accumulates multiple actions on the same tag).

To send an action without an associated page view, call setEulerianStandalone() on the tag — the hit will not count as a page view in Eulerian.

EAOAction methods:

  • setEulerianWithName(_ value: String) — action name (mandatory)
  • setEulerianWithMode(_ value: String) — action direction: "in" (entry) or "out" (exit)
  • setEulerianWithLabel(_ value: String) — action label(s), comma-separated
  • setEulerianWithRef(_ value: String) — reference identifying the action in your systems (optional)
  • setEulerianWithParams(_ value: EAOParams) — additional key/value parameters

Swift — action on a page view

let action1 = EAOAction()
action1.setEulerianWithName("subscription-step1")
action1.setEulerianWithMode("in")
action1.setEulerianWithLabel("premium-offer")

let action2 = EAOAction()
action2.setEulerianWithName("subscription-step1")
action2.setEulerianWithMode("out")
action2.setEulerianWithLabel("abandoned")

let props = EAProperties(path: "subscription|step1")
props.setEulerianWithUid("123asd")
props.addEulerianWithAction(action1)
props.addEulerianWithAction(action2)
EAnalytics.track(props)

Swift — standalone action (no page view)

let action = EAOAction()
action.setEulerianWithName("cta-click")
action.setEulerianWithMode("in")
action.setEulerianWithLabel("hero-banner")

let params = EAOParams()
params.setEulerianWithStringValue("martinique", forKey: "origin")
action.setEulerianWithParams(params)

let props = EAProperties(path: "homepage")
props.setEulerianStandalone()   // does not count as a page view
props.setEulerianWithUid("123asd")
props.addEulerianWithAction(action)
EAnalytics.track(props)

Objective-C

EAOAction *action = [[EAOAction alloc] init];
[action setEulerianWithName:@"cta-click"];
[action setEulerianWithMode:@"in"];
[action setEulerianWithLabel:@"hero-banner"];

EAOParams *params = [[EAOParams alloc] init];
[params setEulerianWithStringValue:@"martinique" forKey:@"origin"];
[action setEulerianWithParams:params];

EAProperties *props = [[EAProperties alloc] initWithPath:@"homepage"];
[props setEulerianStandalone];
[props setEulerianWithUid:@"123asd"];
[props addEulerianWithAction:action];
[EAnalytics track:props];

Context Flag (CFLAG) — EAOSiteCentricCFlag

Attach one or more context flags to any tag to enrich your reports with contextual dimensions. Each flag accepts multiple values.

EAOSiteCentricCFlag methods:

  • setEulerianWithValues(_ values: [String], forKey key: String) — defines a contextual dimension with one or more values

Attach to a tag via:

  • setEulerianWithCFlag(_ value: EAOSiteCentricCFlag) — available on all tag types

Swift

let cflag = EAOSiteCentricCFlag()
cflag.setEulerianWithValues(["rolandgarros", "wimbledon"], forKey: "category_1")
cflag.setEulerianWithValues(["tennis"], forKey: "category_2")
cflag.setEulerianWithValues(["usopen"], forKey: "category_3")

let props = EAProperties(path: "home|main")
props.setEulerianWithUid("123asd")
props.setEulerianWithEmail("email@test.com")
props.setEulerianWithCFlag(cflag)
EAnalytics.track(props)

Objective-C

EAOSiteCentricCFlag *cflag = [[EAOSiteCentricCFlag alloc] init];
[cflag setEulerianWithValues:@[@"rolandgarros", @"wimbledon"] forKey:@"category_1"];
[cflag setEulerianWithValues:@[@"tennis"] forKey:@"category_2"];
[cflag setEulerianWithValues:@[@"usopen"] forKey:@"category_3"];

EAProperties *props = [[EAProperties alloc] initWithPath:@"home|main"];
[props setEulerianWithUid:@"123asd"];
[props setEulerianWithEmail:@"email@test.com"];
[props setEulerianWithCFlag:cflag];
[EAnalytics track:props];

WebView tracking

For hybrid apps that open a WebView, pass the SDK's internal identifier in the opening URL to ensure tracking continuity between the native app and the web session. Also add the edev parameter to qualify traffic as native.

Swift

let euidl = EAnalytics.euidl()

// Build the URL with the required parameters
var components = URLComponents(string: "https://www.example.com/landing")!
components.queryItems = [
    URLQueryItem(name: "ea-euidl-bypass", value: euidl),
    URLQueryItem(name: "edev", value: "AppNativeIOSphone")
]
let webViewURL = components.url!

// Load in the WebView
webView.load(URLRequest(url: webViewURL))

Objective-C

NSString *euidl = [EAnalytics euidl];

NSURLComponents *components = [NSURLComponents componentsWithString:@"https://www.example.com/landing"];
components.queryItems = @[
    [NSURLQueryItem queryItemWithName:@"ea-euidl-bypass" value:euidl],
    [NSURLQueryItem queryItemWithName:@"edev" value:@"AppNativeIOSphone"]
];
[webView loadRequest:[NSURLRequest requestWithURL:components.URL]];

Accepted values for edev:

Value Device
AppNativeIOSphone iPhone
AppNativeIOStablet iPad
AppNativeAndroidphone Android phone
AppNativeAndroidtablet Android tablet

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


App metrics

Track downloads and updates by including these parameters in the first tag sent at app launch.

Parameter Value Description
ea-appname App name App identifier — must never change — collected automatically by the SDK
ea-appversion Version string Current version — collected automatically by the SDK
ea-appinstalled 1 Must be passed manually if the app existed before Eulerian was integrated

These parameters are collected automatically by the SDK on every hit. You only need to pass ea-appinstalled during a migration.

System logic:

  • 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 has a new value compared to the last launch.

Migration (app that existed before Eulerian):

let props = EAProperties(path: "home|main")
props.setEulerianWithValue("1", forKey: "ea-appinstalled")
EAnalytics.track(props)

Consent (GDPR)

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

Mode 1 — TCF v2 (gdpr_consent)

Send the TCString generated by your CMP once per visitor, at the moment the user expresses their opt-in or opt-out.

Swift

let props = EAProperties(path: "universe|section|page")
props.setEulerianWithUid("5434742")
props.setEulerianWithValue("monthly", forKey: "subscription")
props.setEulerianWithValue("EADURF214345", forKey: "gdpr_consent") // your TCString
EAnalytics.track(props)

Mode 2 — Categories (pmcat)

Pass the Eulerian IDs of refused categories, separated by -. Send - alone if the user accepts all categories.

Swift

let props = EAProperties(path: "universe|section|page")
props.setEulerianWithUid("5434742")
props.setEulerianWithValue("monthly", forKey: "subscription")
props.setEulerianWithValue("1-10", forKey: "pmcat") // IDs of refused categories
EAnalytics.track(props)

Example category mapping:

Category Eulerian ID
analytics 1
advertising 10
functional 19

Example: user refuses analytics + advertising → pmcat = 1-10

General opt-out URL

Provide this URL on your "Privacy / GDPR" page or in your CMP for an unconditional full opt-out:

https://<your-collection-domain>/optout.html?url=<your-domain>

Summary

TCF v2 mode Categories mode
Parameter gdpr_consent pmcat
When On opt-in/out On opt-in/out
Content TCString Refused IDs or -
CMP compatibility TCF v2 CMP In-house / non-TCF CMP

Privacy (iOS 14+)

Privacy Manifest

The SDK includes a PrivacyInfo.xcprivacy file declaring the collected data and the system APIs used. This file has been required by the App Store since spring 2024 for third-party SDKs.

Data declared in the manifest:

Data type Usage
Email address Linking
User ID Linking + Tracking
Device ID / IDFV Linking
Purchase history Linking
Product interaction Linking
Other usage data Linking

Declared system API: NSUserDefaults (reason: CA92.1 — offline queue storage).

Tracking domain (NSPrivacyTrackingDomains)

If your application enables advertising tracking (IDFA), add your collection domain to Info.plist:

<key>NSPrivacyTrackingDomains</key>
<array>
    <string>example.demo.com</string>
</array>

IDFA (App Tracking Transparency)

The SDK automatically collects the IDFA if the AdSupport framework is linked and the user has granted permission via ATTrackingManager. No additional configuration is required on the SDK side.

About

iOS tracking library for Eulerian Technologies Analytics.

Resources

Stars

3 stars

Watchers

6 watching

Forks

Releases

Packages

Used by

Contributors

Languages