iOS native
Installation
CocoaPods
If you do not have CocoaPods yet, install it:
sudo gem install cocoapods
If your project does not have a Podfile yet, create one at the project root:
pod init
Add the dependency to your Podfile:
pod 'EAnalytics'
Then run:
pod install
Then open your project through the
.xcworkspacefile generated by CocoaPods (not the.xcodeproj).
Swift Package Manager
In Xcode, choose File → Add Package Dependencies and enter the URL of the Eulerian iOS GitHub repository. 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+
Initialisation
Initialise the SDK once, in application(_:didFinishLaunchingWithOptions:). The SDK is a singleton: a second call to initWithHost is 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 turns debug logs in the Xcode console on (
true) or off (false).
Tracking subdomain: the value to pass is supplied by your Eulerian team. It looks like
example.demo.com; do not includehttps://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 the internal identifier, and the subdomain passed toinitWithHostto attribute the traffic to the right site in the Eulerian interface.
If several apps share the same tracking subdomain, use the
fromparameter throughsetEulerianWithValue(_:forKey:)to tell them apart.
EUIDL: the SDK automatically generates and persists a unique identifier per install (
euidl). It is stored inNSUserDefaultsand survives app updates. You can read it withEAnalytics.euidl().
Offline & retry: if the device has no connection when
trackis called, the tag is serialised locally and sent again automatically on the nexttrackcall or the next app launch. The real timestamp of the interaction is kept (ereplay-time).
Tag types
path(the page name) is mandatory on every tag. It is never picked up automatically, unlike on the web where the URL identifies the page. Use a hierarchical convention with|as the separator, for example"home|accueil","catalogue|chaussures|homme","tunnel|paiement|confirmation". The value is up to you, but it must be stable and meaningful for reporting.
Generic method
setEulerianWithValue(_:forKey:): available on every tag, it lets you add any custom parameter that the dedicated methods do not cover. Example:setEulerianWithValue("mensuel", forKey: "abonnement").
Generic page · EAProperties
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:
initWithPath(_ path: String), page name (mandatory)setEulerianWithUid(_ value: String), internal ID of the logged-in user; consolidates cross-device historysetEulerianWithEmail(_ value: String), the user’s emailsetEulerianWithProfile(_ value: String), the user’s profile (e.g.visitor,buyer,looker)setEulerianWithPageGroup(_ value: String), page group for reportingsetEulerianWithValue(_ value: Any, forKey key: String), free custom parametersetEulerianWithCFlag(_ value: EAOSiteCentricCFlag), attaches one or more context flags (see Context Flag )
Swift
let props = EAProperties(path: "home|accueil")
props.setEulerianWithUid("123asd")
props.setEulerianWithEmail("test@test.fr")
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|accueil"];
[props setEulerianWithUid:@"123asd"];
[props setEulerianWithEmail:@"test@test.fr"];
[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 counts as 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 ID of the usersetEulerianWithEmail(_ value: String), the user’s emailsetEulerianWithProfile(_ value: String), the user’s profilesetEulerianWithPageGroup(_ value: String), page groupsetEulerianWithValue(_ value: Any, forKey key: String), free custom parameter
Building an EAOProduct:
initWithRef(_ ref: String), product reference (mandatory)setEulerianWithName(_ value: String), readable product name for reportingsetEulerianWithGroup(_ value: String), product groupsetEulerianWithParams(_ 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 afterprdparam-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: "produit|fiche")
page.setEulerianWithUid("123asd")
page.setEulerianWithEmail("test@test.fr")
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:@"produit|fiche"];
[page setEulerianWithUid:@"123asd"];
[page setEulerianWithEmail:@"test@test.fr"];
[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 counts as 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 several products.
Swift
let product1 = EAOProduct(ref: "ref-product1")
let product2 = EAOProduct(ref: "ref-product2")
let product3 = EAOProduct(ref: "ref-product3")
let page = EAProducts(path: "categorie|chaussures")
page.setEulerianWithUid("123asd")
page.setEulerianWithEmail("test@test.fr")
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:@"categorie|chaussures"];
[page setEulerianWithUid:@"123asd"];
[page setEulerianWithEmail:@"test@test.fr"];
[page setEulerianWithPageGroup:@"my-pagegroup"];
[page setEulerianWithProducts:@[product1, product2, product3]];
[EAnalytics track:page];
Search engine page · EASearch
Tracks internal search engine queries, the number of results and search parameters. A tag counts as a search engine page when it contains isearchengine. Not exclusive: it 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 returnedsetEulerianWithParams(_ value: EAOParams), search parameters (key/value pairs matchingisearchkey/isearchdata)setEulerianWithUid(_ value: String), internal ID of the usersetEulerianWithValue(_ value: Any, forKey key: String), free custom parameter
Swift
let searchParams = EAOParams()
searchParams.setEulerianWithStringValue("veste", forKey: "motcle")
searchParams.setEulerianWithStringValue("100.00", forKey: "montant_min")
searchParams.setEulerianWithStringValue("400.00", forKey: "montant_max")
let page = EASearch(path: "moteur_interne|veste", withName: "moteur_interne")
page.setEulerianWithUid("34678")
page.setEulerianWithResults(150)
page.setEulerianWithParams(searchParams)
EAnalytics.track(page)
Objective-C
EAOParams *searchParams = [[EAOParams alloc] init];
[searchParams setEulerianWithStringValue:@"veste" forKey:@"motcle"];
[searchParams setEulerianWithStringValue:@"100.00" forKey:@"montant_min"];
[searchParams setEulerianWithStringValue:@"400.00" forKey:@"montant_max"];
EASearch *page = [[EASearch alloc] initWithPath:@"moteur_interne|veste" withName:@"moteur_interne"];
[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. It feeds the “Error pages” report.
Swift
let props = EAProperties(path: "erreur|404")
props.setEulerianWithValue("1", forKey: "error")
EAnalytics.track(props)
Objective-C
EAProperties *props = [[EAProperties alloc] initWithPath:@"erreur|404"];
[props setEulerianWithValue:@"1" forKey:@"error"];
[EAnalytics track:props];
Quote page · EAEstimate
Tracks quotes and the products attached to them. Quotes are deduplicated by reference: a second call with the same reference is ignored.
Methods:
initWithPath(_ path: String, withRef ref: String), page name + unique quote reference (mandatory)setEulerianWithAmount(_ value: Double), total quote amount including tax (decimals separated by a point)setEulerianWithType(_ value: String), quote type according to your own taxonomysetEulerianWithCurrency(_ value: String), currency, if different from the one configured in the interfaceaddEulerian(_ product: EAOProduct, amount: Double, quantity: Int32), adds a product with its unit amount and quantitysetEulerianWithUid(_ value: String), internal ID of the usersetEulerianWithEmail(_ value: String), the user’s emailsetEulerianWithValue(_ value: Any, forKey key: String), free custom parameter
Swift
let product = EAOProduct(ref: "505")
let page = EAEstimate(path: "credit|devis", withRef: "C4536567")
page.setEulerianWithUid("123asd")
page.setEulerianWithEmail("test@test.fr")
page.setEulerianWithAmount(5000.00)
page.setEulerianWithType("credit_48mois")
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|devis" withRef:@"C4536567"];
[page setEulerianWithUid:@"123asd"];
[page setEulerianWithEmail:@"test@test.fr"];
[page setEulerianWithAmount:5000.00];
[page setEulerianWithType:@"credit_48mois"];
[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 started carts and makes it possible to calculate conversion and abandonment rates. A tag counts as a cart page when it contains the scart parameter, set automatically by the EACart class. A cart lives for a rolling 30 minutes.
Methods:
initWithPath(_ path: String), page name (mandatory)setEulerianWithCumul(_ value: Bool),false: the tag’s products represent the whole cart (snapshot);true: products accumulate with each successive calladdEulerian(_ product: EAOProduct, amount: Double, quantity: Int32), adds a product with its unit amount and quantitysetEulerianWithUid(_ value: String), internal ID of the usersetEulerianWithEmail(_ value: String), the user’s emailsetEulerianWithProfile(_ value: String), the user’s profilesetEulerianWithPageGroup(_ value: String), page groupsetEulerianWithValue(_ 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: "panier")
page.setEulerianWithUid("123asd")
page.setEulerianWithEmail("test@test.fr")
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:@"panier"];
[page setEulerianWithUid:@"123asd"];
[page setEulerianWithEmail:@"test@test.fr"];
[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 you do not miss it if the user never comes back to the app after the payment platform.
Methods:
initWithPath(_ path: String, withRef ref: String), page name + unique order reference (mandatory)setEulerianWithAmount(_ value: Double), total amount including tax, excluding shipping (mandatory)setEulerianWithPayment(_ value: String), payment method used (e.g.credit card,paypal)setEulerianWithType(_ value: String), sale type according to your own taxonomysetEulerianWithCurrency(_ value: String), currency, if different from the one configured in the interfacesetEulerianWithNewCustomer(_ value: Bool),true: new buyer;false: returning customersetEulerianWithEstimateRef(_ value: String), reference of the quote linked to this order (optional)addEulerian(_ product: EAOProduct, amount: Double, quantity: Int32), adds a product with its unit amount and quantitysetEulerianWithUid(_ value: String), internal ID of the usersetEulerianWithEmail(_ value: String), the user’s emailsetEulerianWithProfile(_ value: String), the user’s profilesetEulerianWithValue(_ 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: "tunnel|confirmation", withRef: "F654335671")
page.setEulerianWithUid("123asd")
page.setEulerianWithEmail("test@test.fr")
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:@"tunnel|confirmation" withRef:@"F654335671"];
[page setEulerianWithUid:@"123asd"];
[page setEulerianWithEmail:@"test@test.fr"];
[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];
Merchandising tracking · EATpView / EATpClick
Tracks impressions and clicks on merchandising blocks (recommendation lists, banners and so on). Sent as GET to /tpview/ and /tpclick/, unlike the other tags, which are sent as POST. Supports the same offline retry mechanism as the rest of the SDK.
Methods EATpView (impression):
initWithPath(_ path: String), reference page (mandatory)setSiteName(_ value: String), name of the merchant sitesetCampaign(_ value: String), campaign namesetPlacement(_ value: String), placement of the block on the pageaddProductWithRef(_ ref: String, position: NSNumber), product reference and its position in the block; repeat for each product shownsetUrl(_ value: String), context URLsetPublisher(_ value: String), publisher (optional)setMedia(_ value: String), media type (optional)setCategory(_ value: String), block category (optional)
Methods EATpClick (click):
initWithPath(_ path: String), reference page (mandatory)setSiteName(_ value: String), name of the merchant sitesetCampaign(_ value: String), campaign namesetPlacement(_ value: String), placement of the block on the pagesetProductWithRef(_ 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 blocksetUrl(_ value: String), context URLsetPublisher(_ value: String), publisher (optional)setMedia(_ value: String), media type (optional)setCategory(_ value: String), block category (optional)
Swift
// Impression on a merchandising 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 in 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:0];
[click setUrl:@"https://www.example.com"];
[EAnalytics track:click];
Actions · EAOAction
Actions let you track user interactions (subscription funnel, questionnaire, moving between sections and so on) outside standard page views. An action can be attached to any tag with setEulerianWithAction: (replaces any previous action) or addEulerianWithAction: (accumulates several actions on the same tag).
To send an action with no associated page view, call setEulerianStandalone() on the tag: the hit will not count as a page view in Eulerian.
Methods EAOAction:
setEulerianWithName(_ value: String), action name (mandatory)setEulerianWithMode(_ value: String), direction of the action:"in"(entry) or"out"(exit)setEulerianWithLabel(_ value: String), action label(s), comma-separatedsetEulerianWithRef(_ value: String), reference identifying the action in your systems (optional)setEulerianWithParams(_ value: EAOParams), extra key/value parameters
Swift · action on a page view
let action1 = EAOAction()
action1.setEulerianWithName("souscription-etape1")
action1.setEulerianWithMode("in")
action1.setEulerianWithLabel("offre-premium")
let action2 = EAOAction()
action2.setEulerianWithName("souscription-etape1")
action2.setEulerianWithMode("out")
action2.setEulerianWithLabel("abandon")
let props = EAProperties(path: "souscription|etape1")
props.setEulerianWithUid("123asd")
props.addEulerianWithAction(action1)
props.addEulerianWithAction(action2)
EAnalytics.track(props)
Swift · standalone action (no page view)
let action = EAOAction()
action.setEulerianWithName("clic-cta")
action.setEulerianWithMode("in")
action.setEulerianWithLabel("hero-banner")
let params = EAOParams()
params.setEulerianWithStringValue("martinique", forKey: "provenance")
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:@"clic-cta"];
[action setEulerianWithMode:@"in"];
[action setEulerianWithLabel:@"hero-banner"];
EAOParams *params = [[EAOParams alloc] init];
[params setEulerianWithStringValue:@"martinique" forKey:@"provenance"];
[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. A tag accepts at most 10 context flag values, across all dimensions.
Methods EAOSiteCentricCFlag:
setEulerianWithValues(_ values: [String], forKey key: String), defines a contextual dimension with one or more values
Added to a tag with:
setEulerianWithCFlag(_ value: EAOSiteCentricCFlag), available on every tag type
Swift
let cflag = EAOSiteCentricCFlag()
cflag.setEulerianWithValues(["rolandgarros", "wimbledon"], forKey: "categorie_1")
cflag.setEulerianWithValues(["tennis"], forKey: "categorie_2")
cflag.setEulerianWithValues(["usopen"], forKey: "categorie_3")
let props = EAProperties(path: "home|accueil")
props.setEulerianWithUid("123asd")
props.setEulerianWithEmail("email@test.fr")
props.setEulerianWithCFlag(cflag)
EAnalytics.track(props)
Objective-C
EAOSiteCentricCFlag *cflag = [[EAOSiteCentricCFlag alloc] init];
[cflag setEulerianWithValues:@[@"rolandgarros", @"wimbledon"] forKey:@"categorie_1"];
[cflag setEulerianWithValues:@[@"tennis"] forKey:@"categorie_2"];
[cflag setEulerianWithValues:@[@"usopen"] forKey:@"categorie_3"];
EAProperties *props = [[EAProperties alloc] initWithPath:@"home|accueil"];
[props setEulerianWithUid:@"123asd"];
[props setEulerianWithEmail:@"email@test.fr"];
[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 so that tracking carries on between the native app and the web session. Also add the edev parameter to flag the traffic as native.
Swift
let euidl = EAnalytics.euidl()
// Build the URL with the mandatory 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 it 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-bypassmust 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 the three parameters below. The first two are collected automatically by the SDK on every hit: there is nothing for you to do. The third, ea-appinstalled, is the only one you pass by hand, and only during a migration.
| 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 | To pass manually if the app existed before the Eulerian integration |
System logic:
- The Download metric is incremented when
ea-appnameis seen for the first time for this user (withoutea-appinstalled). - The Update metric is incremented when
ea-appnameis unchanged butea-appversionhas a new value compared with the last launch.
Migration (app that existed before Eulerian):
let props = EAProperties(path: "home|accueil")
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 app.
Mode 1 · TCF v2 (gdpr_consent)
Pass the TCString generated by your CMP once per visitor, at the moment the user opts in or out.
Swift
let props = EAProperties(path: "univers|rubrique|page")
props.setEulerianWithUid("5434742")
props.setEulerianWithValue("mensuel", forKey: "abonnement")
props.setEulerianWithValue("EADURF214345", forKey: "gdpr_consent") // your TCString
EAnalytics.track(props)
Mode 2 · Categories (pmcat)
Pass the Eulerian IDs of the refused categories, separated by -. Send - on its own if the user accepts every category.
Swift
let props = EAProperties(path: "univers|rubrique|page")
props.setEulerianWithUid("5434742")
props.setEulerianWithValue("mensuel", forKey: "abonnement")
props.setEulerianWithValue("1-10", forKey: "pmcat") // IDs of the refused categories
EAnalytics.track(props)
Example category mapping:
| Category | Eulerian ID |
|---|---|
| analytics | 1 |
| advertising | 10 |
| functional | 19 |
Example: the user refuses analytics and advertising, so pmcat is 1-10.
General opt-out URL
Provide this URL on your “Privacy / GDPR” page or in your CMP for a full, unconditional opt-out:
https://<votre-domaine-de-collecte>/optout.html?url=<votre-domaine>
Summary
| TCF v2 mode | Categories mode | |
|---|---|---|
| Parameter | gdpr_consent | pmcat |
| When | At opt-in/out | At 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 data collected and the system APIs used. The App Store has required this file for third-party SDKs since spring 2024.
Data declared in the manifest:
| Data type | Use |
|---|---|
| Email address | Linking |
| User ID | Linking + Tracking |
| Device ID / IDFV | Linking |
| Purchase history | Linking |
| Product interaction | Linking |
| Other usage data | Linking |
System API declared: NSUserDefaults (reason: CA92.1 · storage of the offline queue).
Tracking domain (NSPrivacyTrackingDomains)
If your app enables ad 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 collects the IDFA automatically if the AdSupport framework is linked and the user has granted permission through ATTrackingManager. No extra configuration is needed on the SDK side.