Event tracking

Overview


Everything your customers do in your mobile application is recorded in the system in real time, queued and automatically sent in batches to Synerise. Information such as the source of the visit, the URL address they have visited, and the chain of actions that followed are saved in Synerise as events and their parameters.

The scope of information gathered about events is wide. Synerise collects predefined event parameters which can be extended according to the preferences and needs of the Synerise customers.

The basic information about the tracked events includes:

  • Action name – an indicator of the activity type, such as screen.view
  • Label – human-readable information about the activity, such as the page title. Must be at least one character.
    This is a deprecated field. It's not saved in the database. so it can't be used in Decision Hub or Automation Hub.
  • Time – the time when the event occurred
  • Customer identification – an identifier of the customer who performed the activity
  • Parameters – additional parameters, depending on the type of the event
    Click here to see example of an event
    { "action": "screen.view", "eventUUID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "unique": null, "createDate": 1659456038993, "label": "PromotionViewScreen", "params": { "ip": "xx.xx.xxx.xxx", "source": "MOBILE_APP", "clientId": 1111111111, "uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "eventUUID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "businessProfileId": 1234, "eventCreateTime": "2022-08-02T16:00:38.993Z", "time": 1659456038993, "modifiedBy": { "businessProfileApiKey": null, "clientApiKey": null, "clientId": null, "userId": null }, "clientId": 5790194467, } }

Some events are predefined, meaning they have a fixed set of fields that must be sent. For example, a product.view event must include the product ID.

You can enrich events with data from catalogs in Synerise, for example, a product or service event where only an ID has been provided can be enriched with other details such as the description, image URL, and more.

Queue and flushing

As a compromise between how quick events are sent and battery life, events are collected into batches and queued for sending (flushing) after enough events are collected or too much time passes (timeout), according to SDK settings.

Since Android SDK 5.17.0 and iOS SDK 4.17.0, the default settings flush the queue immediately when a push event is added to it.

You can change the queue size, timeout, list of events which trigger flushing, and other event tracking settings as described in the "Tracker" section of the "Settings" article.

To flush the queue on demand, use the following methods:

OS Method
Android Tracker.flush()
iOS flushEvents(completionHandler: (() -> Void)?)
React Native flushEvents(onSuccess: () => void)
Flutter Synerise.tracker.flush()

Events tracked automatically


Auto-Tracking

Automatic tracking is available only for Android SDK and iOS SDK. Auto-tracking is not supported for applications built with Jetpack Compose and SwiftUI. These applications should use declarative tracking.

Auto-tracking allows you to monitor each type of the customer activity in your mobile application and it is enabled by default. Every interaction (such as click, view, swipe) with any element in the application can be sent as an event to Synerise together with a collection of details concerning the event, which are available in the overview on the profile's card. The frequency and the kind of the tracked events are customizable, as you can switch on tracking a particular types of interactions.

Configuration

Auto-tracking events is:

  • Enabled by default for Android.
  • Disabled by default for iOS.

Available modes for auto-tracking:

  • DISABLED - Listeners are disabled (default mode for iOS SDK).
  • PLAIN - Listeners are set to track screen-visits only.
  • FINE - Listeners are attached to nearly everything that is clickable in your app, including screen visits that record the visited screen event (default mode for Android SDK).

You may configure auto-tracking with various options to customize your expected behavior and track events you want. See possible configuration options below:

Synerise.settings.tracker.autoTracking.enabled = false; // 1
Synerise.settings.tracker.autoTracking.enabled = false; // 1
Synerise.settings.tracker.autoTracking.enabled = true // 1
Synerise.settings.tracker.autoTracking.mode = .fine // 2
Synerise.settings.tracker.autoTracking.excludedClasses = [SNRSampleViewController.self] // 3
Synerise.settings.tracker.autoTracking.excludedViewTags = [1, 2] // 4
SNRSynerise.settings.tracker.autoTracking.enabled = YES; // 1
SNRSynerise.settings.tracker.autoTracking.mode = SNRTrackerAutoTrackModeFine; // 2
SNRSynerise.settings.tracker.autoTracking.excludedClasses = @[SNRSampleViewController.class]; // 3
SNRSynerise.settings.tracker.autoTracking.excludedViewTags = @[@1, @2]; // 4
  1. It enables/disables auto-tracking.
  2. It sets auto-tracking mode.
  3. It is an array of classes that you want to exclude from auto-tracking.
  4. It is an array of tag numbers for views that you want to exclude from auto-tracking.

Events from Auto-Tracking

Action name Description Label Additional information tracked
screen.view This event is generated when any screen of a mobile app is displayed by a mobile app user. Activity, Fragment names (for example, ProductDetailsFragment)
screen.interaction This event is generated every time a mobile app user interacts with any element of the application UI. viewText or the name of control type (if not able to read a value) Depending on the UI element type tracked, Synerise automatically reads and passes any values that are set depending on type, such as: time, date, position, progress, state, value, or if the element has been selected.

Depending on the UI element type tracked, Synerise automatically reads and passes any values that are set depending on type, such as: time, date, position, progress, state, value, or if the element has been selected.

Action name Description Activity class Label
screen.view This event is generated when any screen of a mobile app is displayed by a mobile app user. UIViewController View controllers name (for example, MyApp.ProductDetailsViewController)
screen.interaction This event is generated every time a mobile app user interacts with any element of the application UI. UIButton
UISwitch
UISegmentedControl
UISlider
UIStepper
UIDatePicker
viewText or name of control type (if not able to read value)

Events tracked internally

In addition to declarative event tracking and Auto-Tracking, many events are generated by the SDK and the Synerise infrastructure.

Read more about all Synerise events

Lifecycle events

Some events are automatically generated by the SDK or backend as a result of the profile's activity.

Action name Source Description
client.applicationStarted SDK A user opened the mobile application. This event contains additional info such as operating system, device model, the sdk version etc.
client.applicationCrashed SDK Report about a mobile application crash, with additional data for troubleshooting.
click.errorReceiver SDK The event is called when the SDK cannot start an intent because there is no attached Activity (ActivityNotFoundException).
session.start BACKEND A user opened the mobile application and a session was opened. The session ends when 30 minutes pass since the last activity.
session.end BACKEND 30 minutes passed since the last activity and the session was closed.

In the following example of aclient.applicationStarted event, the highlighted data is added automatically:

{
  "action": "client.applicationStarted",
  "eventUUID": "9f9f81ce-fb3d-432d-8f88-a4ce20ac3c0d",
  "label": "AppStarted",
  "params": {
    "deviceType": "SMARTPHONE", // SMARTPHONE or TABLET
    "deviceId": "B36535BD-7C80-4D90-A941-26CD4DB7FA7C",
    "osLanguage": "pl", // Language set in operating system
    "appVersionCode": "8", // Build number of the mobile app
    "systemPushConsent": "enabled", // System consent for push notifications
    "source": "MOBILE_APP",
    "networkType": "WIFI", // WIFI or CELL
    "cellCountry": "--",
    "deviceModel": "iPhone13,1", // Model of a device
    "os": "ios", // iOS or Android
    "applicationType": "UNKNOWN",
    "deviceRooted": "false",
    "applicationName": "SDK Sample App Swift",
    "appVersion": "4.16.0", // Version of the mobile app
    "cellCarrier": "--",
    "origin": "APP_STARTED",
    "deviceManufacturer": "Apple", // Manufacturer of a device
    "sdkVersion": "4.16.0", // SDK version in the mobile app
    "sdkPreviousVersion": "4.15.0", // SDK version previously installed in the mobile app
    "sdkPluginVersion": "1.2.0", // SDK plugin version in the mobile app (in hybrid apps, for example built with Flutter)
    "osVersion": "17.3.1", // OS version of a device
    "deviceId": "B36535BD-7C80-4D90-A941-26CD4DB7FA7C",
    "deviceResolution": "1080x2338", // Resolution of device screen
    (...)
  }
}

Profile events

Some events are automatically generated as a result of an action or interaction with the profile such as registration, authorizations, and more.

Check details of profile's events.

Action name Source Description
client.anonymousLogin BACKEND An anonymous profile generated a new authentication token.
client.simpleAuthLogin BACKEND A user logged in with Simple Profile Authentication
client.register BACKEND A profile was registered successfully. This event is only generated for Registration-as-a-Service.
client.tryToLogInToInactiveAccount BACKEND A profile tried to log in to an inactive account.
client.login BACKEND A user logged in mobile application. This event is only generated for OAuth and Synerise Authentication (aka RaaS).
client.logout BACKEND A user logged out from the mobile application. By default, this event is generated only when you use Synerise Authentication (aka RaaS).
client.merge BACKEND Two or more profiles were merged into one.
profile.updated BACKEND A profile was updated.

Push Notifications events

Some events are automatically generated as a result of an action or interaction of the profile with push notifications.

To ensure correct tracking of push notification events, you must configure push notifications first.

Check details of push notification events.

Action name Source Description
push.view SDK A push notification was shown to the app user.
push.notView SDK A push notification was sent, but the device did not display it due to the areNotificationsEnabled setting on the device. This event is only generated for Android 7.0 or later.
push.click SDK A push notification was tapped.
push.button.click SDK DEPRECATED A button in a push notification was tapped.
push.openInApp SDK A push notification was tapped and the app was opened. This event is only generated for iOS.
push.dismiss SDK A push notification was dismissed. The event requires configuring Notification Service Extension for full support.
push.imageTimeout SDK An image in a mobile push notification could not be loaded.
push.controlGroup BACKEND A mobile push notification was not sent because the recipient belongs to the control group.
push.send BACKEND A push notification was sent to a profile.
push.notSent BACKEND A push notification failed to be created by the backend. Usually occurs when notification encryption is enabled in your business profile, but your application did not generate a key pair.
push.capping BACKEND A push notification was not sent due to message limits set for this type of communication.
push.skipped BACKEND A push notification was not sent because Silence Hours were active. If the process of sending multiple messages overlaps with Silence Hours, sending is stopped in progress.
push.tokenUpdate BACKEND A Firebase registration token was updated in the Synerise system.
push.tokenDelete BACKEND A Firebase registration token was deleted when a backend tried to send a push notification. Usually occurs when it is a problem with user's token.
push.notRegistered BACKEND A push notification was not sent due to an invalid Firebase token.
push.invalidRegistrationId BACKEND A push notification was not sent due to an incorrectly assigned registrationId in Firebase.
push.mismatchSenderId BACKEND A push notification was not sent, because the Firebase project to which the profile was registered changed.

In these events campaign data is always tracked. See specified part of push.view event below:

{
  "action": "push.view",
  "eventUUID": "eca5662f-ecfd-418a-af5c-e65ba10ca252",
  "label": "Test Simple Push",
  "params": {
    "id": "ecf5678d-c137-44d1-964f-83bc8d15511e", // Campaign ID
    "variantId": 11598412, // Variant ID of the campaign
    "campaignTitle": "Test Simple Push", // Campaign title
    "campaignType": "Mobile push", // Campaign type
    (...)
  }
}

In-App Messages events

Sort events are automatically generated as a result of an action or interaction with in-app messages by the user of the mobile app.

Read more about the details of in-app messages events.

Action name Source Description
inApp.show SDK An in-app message was shown to the app user.
inApp.capping SDK An in-app message was not displayed due to capping or frequency limits.
inApp.click SDK The content of an in-app message was tapped.
inApp.controlGroup SDK An in-app message was not displayed because the recipient belongs to the control group.
inApp.discard SDK An in-app message was closed.
inApp.hide SDK An in-app message was hidden.
inApp.customHook SDK A custom action (implemented by your app developers and included in the in-app definition) from an in-app message was triggered.
inApp.renderFail SDK / BACKEND An in-app message was not displayed due to an error. This may be caused, for example, by an error in the Jinjava syntax or a connection problem.

In these events campaign data is always tracked. See specified part of inApp.show event below:

{
  "action": "inApp.show",
  "eventUUID": "e982ed4d-9179-4bc3-9266-322ff4a8f2eb",
  "label": "In-app message was displayed in mobile app",
  "params": {
    "id": "83e13e0b-7930-4866-a2cf-088dcbe0b222", // Campaign ID
    "variantId": "c3bbfc16-a79e-474f-a255-ef7ee1333148", // Variant ID of the campaign
    (...)
  }
}

Other campaigns events

Other events are which automatically generated as a result of an action related to campaigns.

Action name Source Description
screen.content SDK A Screen View campaign was generated and fetched for the profile in the mobile app. It contains data with a sorted tree of the documents.
client.activatePromotion BACKEND A promotion was activated by the profile.
client.deactivatePromotion BACKEND A promotion was deactivated by the profile.
recommendation.generated BACKEND A recommendation set was generated for a profile.
recommendation.view SDK A recommendation frame was displayed to a user. The parameters may include a list of the items in the frame, depending on your implementation. Event from Content Widget.
recommendation.seen SDK A recommendation frame was displayed to a user. The parameters may include a list of the items in the frame, depending on your implementation. Event from Content Widget.
recommendation.click SDK A recommended item was clicked. Event from Content Widget.
product.like SDK The Content Widget includes a "like" button that was tapped by the user.
product.dislike SDK The Content Widget includes a "dislike" button that was tapped by the user.

Declarative tracking


Declarative tracking is a feature of our SDK that allows you to declare additional actions for tracking.

Product views, screen views, clicking a sign up button, contact with the call center, and more: you can implement anything and declarative tracking will help you to do that.

DO NOT send transaction.charge events as custom events.
Transactions must be tracked with these endpoints:

Basic custom event

In the most basic scenario, you can pass an event as in the examples below:

Tracker.send(new CustomEvent("my.action", "label"));
let event: CustomEvent = CustomEvent(label: "label", action: "my.action")
Tracker.send(event)
SNRCustomEvent *event = [[SNRCustomEvent alloc] initWithLabel:@"label" action:@"my.action"];
[SNRTracker send:event];
let event = new CustomEvent("label", "my.action", parameters);
Synerise.Tracker.send(event);
CustomEvent event = CustomEvent("label", "my.action", parameters);
Synerise.tracker.send(event)

Such events are passed to Synerise as the CustomEvent type, since the action can be anything that you want.

  • The action name must follow the context.action convention. For example: screen.view, product.buy, social.share
  • The action name must be up to 32 characters long and must match the following regular expression:
    ^[a-zA-Z0-9\.\-_]+$
    

Custom events with more parameters

If you want to send more complex events, you can include additional parameters:

TrackerParams params = new TrackerParams.Builder()
                .add("name", "John")
                .add("surname", "Rise")
                .add("company", "Synerise")
                .add("age", 25)
                .add("isGreat", true)
                .add("lastOrder", 384.28)
                .add("count", 0x7fffffffffffffffL)
                .add("someObject", new MySerializableObject())
                .build();
Tracker.send(new CustomEvent("my.action", "label", params));
val params = TrackerParams.Builder()
.add("name", "John")
.add("surname", "Rise")
.add("company", "Synerise")
.add("age", 25)
.add("isGreat", true)
.add("lastOrder", 384.28)
.add("count", 0x7fffffffffffffffL)
.add("someObject", MySerializableObject())
.build()
Tracker.send(CustomEvent("my.action", "label", params))
let parameters: TrackerParams = TrackerParams.make {
    builder in
    builder.setString("John", forKey: "name")
    builder.setString("Rise", forKey: "surname")
    builder.setString("Synerise", forKey: "company")
    builder.setInt(57, forKey: "age")
    builder.setBool(true, forKey: "isGreat")
    builder.setDouble(384.28, forKey: "lastOrder")
    builder.setInt(10, forKey: "count")
    builder.setObject(SampleObject(), forKey: "someObject")
}   

let event: CustomEvent = CustomEvent(label: "label", action: "my.action", params: parameters)

Tracker.send(event)
SNRTrackerParams *parameters = [SNRTrackerParams makeWithBuilder:^(SNRTrackerParamsBuilder *builder) {
    [builder setString:@"John" forKey:@"name"];
    [builder setString:@"Rise" forKey:@"surname"];
    [builder setString:@"Synerise" forKey:@"company"];
    [builder setInt:25 forKey:@"age"];
    [builder setBool:YES forKey:@"isGreat"];
    [builder setDouble:384.28 forKey:@"lastOrder"];
    [builder setInt:10 forKey:@"count"];
    [builder setObject:[SampleObject new] forKey:@"someObject"];
}];

SNRCustomEvent *event = [[SNRCustomEvent alloc] initWithLabel:@"label" action:@"my.action" andParams:parameters];

[SNRTracker send:event];
let parameters = {
  "name": "John",
  "surname": "Rise",
  "company": "Synerise",
  "age": 25,
  "lastOrder": 380.50
};

let event = new CustomEvent("label", "my.action", parameters);
Synerise.Tracker.send(event);
final parameters = <String, String>{
  "name": "Rise",
  "surname": "Rise",
  "company": "Synerise",
  "age": 25,
  "lastOrder": 380.50
};

CustomEvent event = CustomEvent("label", "my.action", parameters);
Synerise.tracker.send(event)

The following keys are reserved and you can't send them: modifiedBy, apiKey, eventUUID, ip, time, businessProfileId. If you add them to an event, they are ignored.

Predefined events

Synerise offers a set of predefined event types that require a minimum set of data for the backend.

They can be sent by using Setters as in the following example. The example uses the Product viewed event.

TrackerParams params = new TrackerParams.Builder()
                .add("campaignHash", "4321")
                .add("campaignId", "1234")
                .build();
ProductViewEvent event = new ProductViewEvent(("Smartphone X", "SM-01-S", "Smartphone X”, params);
event.setCategory(“Smartphones”);
event.setUrl(“myapp://products/CM01-R");
Tracker.send(event);
val params = TrackerParams.Builder()
.add("campaignHash", "4321")
.add("campaignId", "1234")
.build()
val event = ProductViewEvent(("Smartphone X"), "SM-01-S", "Smartphone X", params)
event.setCategory("Smartphones")
event.setUrl("myapp://products/CM01-R")
Tracker.send(event)
let parameters: TrackerParams = TrackerParams.make {
    builder in
    builder.setString("12345", forKey: "campaignId")
    builder.setString("campaign12345", forKey: "campaignHash")
}     
let event: ProductViewEvent = ProductViewEvent(label: "Smartphone X", productName: "Smartphone X", productID:"SM-01-S", params: parameters)
event.setCategory("Smartphones")
event.setURL(URL(string: "myapp://products/SM-01-S")

Tracker.send(event)
SNRTrackerParams *parameters = [SNRTrackerParams makeWithBuilder:^(SNRTrackerParamsBuilder *builder) {
    [builder setString:@"12345" forKey:@"campaignId"];
    [builder setString:@"campaign12345" forKey:@"campaignHash"];
}];

SNRProductViewEvent *event = [[SNRProductViewEvent alloc] initWithLabel:@"Smartphone X" productName:@"Smartphone X" productId:@"SM-01-S" andParams:parameters];
[event setCategory:@"Smartphones"];
[event setURL:[NSURL URLWithString:@"myapp://products/SM-01-S"]];

[SNRTracker send:event];
let parameters = {
    "campaignHash": "1234",
    "campaignId": "1234"
};

let event = ProductViewEvent("Smartphone X", "Smartphone X", "SM-01-S", parameters);
event.setCategory("Smartphones");
event.setURL("myapp://products/SM-01-S");
Synerise.Tracker.send(event);
Map<String, dynamic> parameters = {
    "campaignHash": "1234",
    "campaignId": "1234",
  };

  var event = ProductViewEvent(
    "Smartphone X",
    "Smartphone X",
    "SM-01-S",
    parameters,
  );
  event.setCategory("Smartphones");
  event.setURL("myapp://products/SM-01-S");
  Synerise.tracker.send(event)
Android iOS React Native Flutter
Tracker.send(event) method Tracker.send(_:) method Synerise.Tracker.send(event) method Synerise.tracker.send(event) method

Predefined event list


The list contains the list of predefined events which you can implement.

Customer registered


This event may be used if you do not use Synerise registration/authentication features and rely fully on your own mechanisms, but still want to gather events when a customer registers.

Action name of the generated event: client.register

Example:

RegisteredEvent event = new RegisteredEvent("label")
Tracker.send(event);
val event = RegisteredEvent("label")
Tracker.send(event)
let event: RegisteredEvent = RegisteredEvent(label: "LABEL")

Tracker.send(event)
SNRRegisteredEvent *event = [[SNRRegisteredEvent alloc] initWithLabel:@"LABEL"];
    
[SNRTracker send:event];
var object: Object = {
  user: 'John',
  lastName: 'Doe',
}

let registeredEvent = new RegisteredEvent('Auth label', object)


Synerise.Tracker.send(registeredEvent)
RegisteredEvent registeredEvent = RegisteredEvent('label', {});
Synerise.tracker.send(registeredEvent);
OS Event Required fields
Android RegisteredEvent Label
iOS RegisteredEvent Label
React Native RegisteredEvent Label
Flutter RegisteredEvent Label

Customer logged in event


This event may be used if you do not use Synerise login/authentication features and rely fully on your own mechanisms, but still want to gather events when a customer logs in.

Action name of the generated event: client.login

Logged in event
Logged in event

Example:

LoggedInEvent event = new LoggedInEvent("label")
Tracker.send(event);
val event = LoggedInEvent("label")
Tracker.send(event)
let event: LoggedInEvent = LoggedInEvent(label: "LABEL")

Tracker.send(event)
SNRLoggedInEvent *event = [[SNRLoggedInEvent alloc] initWithLabel:@"LABEL"];
    
[SNRTracker send:event];
var object: Object = {
user: 'John',
lastName: 'Doe',
 }


let loggedInEvent = new LoggedInEvent('Auth label', object)
Synerise.Tracker.send(loggedInEvent)
LoggedInEvent event = LoggedInEvent('label', {});
Synerise.tracker.send(event);
OS Event Required fields
Android LoggedInEvent Label
iOS LoggedInEvent Label
React Native LoggedInEvent Label
Flutter LoggedInEvent Label

Customer logged out


This event may be used if you do not use Synerise login/authentication features and rely fully on your own mechanisms, but still want to gather events when a customer logs out.

Action name of the generated event: client.logout

Example:

LoggedOutEvent event = new LoggedOutEvent("label")
Tracker.send(event);
val event = LoggedOutEvent("label")
Tracker.send(event)
let event: LoggedOutEvent = LoggedOutEvent(label: "LABEL")

Tracker.send(event)
SNRLoggedOutEvent *event = [[SNRLoggedOutEvent alloc] initWithLabel:@"LABEL"];
    
[SNRTracker send:event];
var object: Object = {
user: 'John',
lastName: 'Doe',
 }


let loggedOutEvent = new LoggedOutEvent('Auth label', object)
Synerise.Tracker.send(loggedOutEvent)
LoggedOutEvent event = LoggedOutEvent('label', {})
Synerise.tracker.send(event);
OS Event Required fields
Android LoggedOutEvent Label
iOS LoggedOutEvent Label
React Native LoggedOutEvent Label
Flutter LoggedOutEvent Label

Product viewed


Use this event to track customer visits to a product in your mobile application.

Action name of the generated event: product.view

Event sent when the mobile app user sees an item
Event sent when the mobile app user sees an item

Example:

ProductViewEvent event = new ProductViewEvent("label", "productId", "productName");
Tracker.send(event);
val event = ProductViewEvent("label", "productId", "productName")
Tracker.send(event)
let event: ProductViewedEvent = ProductViewedEvent(label: "LABEL", productName: "PRODUCT_NAME", productId: "12345", params: nil)
event.setCategory("PRODUCT_CATEGORY")
event.setURL(URL(string: "PRODUCT_URL")!)
event.setIsRecommended(true)

Tracker.send(event)
SNRProductViewedEvent *event = [[SNRProductViewedEvent alloc] initWithLabel:@"LABEL" productName:@"PRODUCT_NAME" productId:@"12345" andParams:nil];
[event setCategory:@"PRODUCT_CATEGORY"];
[event setURL:[NSURL URLWithString:@"PRODUCT_URL"]];
[event setIsRecommended:YES];

[SNRTracker send:event];
var object: Object = {
    campaign: 'Computer bargain',
    lastTo: 'December',
  }

let productEventTest = new ProductViewEvent('product view label', '1234', 'Computer', object)
Synerise.Tracker.send(productEventTest)
ProductViewedEvent event = ProductViewedEvent('label', 'productId', 'productName',{});
Synerise.tracker.send(event);
OS Event Required fields
Android ProductViewEvent Label, ProductId, Name
iOS ProductViewedEvent Label, ProductId, Name
React Native ProductViewedEvent Label, ProductId, Name
Flutter ProductViewedEvent Label, ProductId, Name

Product added to favorites


Use this event to track adding a product to favorites in your mobile application.

Action name of the generated event: product.addToFavorite

Event sent when a mobile app user adds an item to favorites
Event sent when a mobile app user adds an item to favorites

Example:

AddedToFavoritesEvent event = new AddedToFavoritesEvent("label");
Tracker.send(event);
val event = AddedToFavoritesEvent("label")
Tracker.send(event)
let event: ProductAddedToFavoritesEvent = ProductAddedToFavoritesEvent(label: "LABEL")

Tracker.send(event)
SNRProductAddedToFavoritesEvent *event = [[SNRProductAddedToFavoritesEvent alloc] initWithLabel:@"LABEL"];
    
[SNRTracker send:event];
var object: Object = {
    product: 'computer',
    screenSize: 15,
  }

  let event = new AddedToFavouritesEvent('Hit Timer Event Label', object)

  Synerise.Tracker.send(event)
ProductAddedToFavoritesEvent event = ProductAddedToFavoritesEvent('label',{});
Synerise.tracker.send(event);
OS Event Required fields
Android AddedToFavoritesEvent Label
iOS ProductAddedToFavoritesEvent Label
React Native ProductAddedToFavouritesEvent Label
Flutter ProductAddedToFavouritesEvent Label

Product added to cart


Use this event to track adding a product to a cart in your mobile application.

Action name of the generated event: product.addToCart

Event sent when a user adds an item to cart
Event sent when a mobile app user adds an item to cart

Example:

UnitPrice unitPrice = new UnitPrice(price, Currency.getInstance(Locale.US));
AddedToCartEvent event = new AddedToCartEvent("label", "sku", unitPrice, 1);
Tracker.send(event);
val unitPrice = UnitPrice(price, Currency.getInstance(Locale.US))
val event = AddedToCartEvent("label", "sku", unitPrice, 1)
Tracker.send(event)
let regularPrice: UnitPrice = UnitPrice(amount: 200)
let discountedPrice: UnitPrice = UnitPrice(amount: 100)
let finalPrice: UnitPrice = UnitPrice(amount: 100)

let event: ProductAddedToCartEvent = ProductAddedToCartEvent(label: "LABEL", sku: "SKU12345", finalPrice: finalPrice, quantity: 1)
event.setName("PRODUCT_NAME")
event.setCategory("PRODUCT_CATEGORY")
event.setCategories(["PRODUCT_CATEGORY_1", "PRODUCT_CATEGORY_2"])
event.setProducer("PRODUCT_PRODUCER")
event.setOffline(false)
event.setRegularPrice(regularPrice)
event.setDiscountedPrice(discountedPrice)
event.setURL(URL(string: "URL")!)

Tracker.send(event)
SNRProductAddedToCartEvent *event = [[SNRProductAddedToCartEvent alloc] initWithLabel:@"LABEL" sku:@"SKU12345" finalPrice:finalPrice quantity:1];
[event setName:@"PRODUCT_NAME"];
[event setCategory:@"PRODUCT_CATEGORY"];
[event setCategories:@[@"PRODUCT_CATEGORY_1", @"PRODUCT_CATEGORY_2"]];
[event setProducer:@"PRODUCT_PRODUCER"];
[event setOffline:NO];
[event setRegularPrice:regularPrice];
[event setDiscountedPrice:discountedPrice];
[event setURL:[NSURL URLWithString:@"URL"]];

[SNRTracker send:event];
var object: Object = {
    campaign: 'Computer bargain',
    lastTo: 'December',
  }

  let price = new UnitPrice(10, 'PLN')
  let addedToCartEvent = new AddedToCartEvent('Cart Label', '12345', price, 15, object)
  Synerise.Tracker.send(addedToCartEvent)
UnitPrice unitPrice = UnitPrice(price,'PLN');
ProductAddedToCartEvent event = ProductAddedToCartEvent('label', 'sku', unitPrice, 1, {});
Synerise.tracker.send(event);
OS Event Required fields
Android AddedToCartEvent Label, Sku, FinalPrice, Quantity
iOS ProductAddedToCartEvent Label, SKU, FinalPrice, Quantity
React Native ProductAddedToCartEvent Label, SKU, FinalPrice, Quantity
Flutter ProductAddedToCartEvent Label, SKU, FinalPrice, Quantity

Product removed from cart


Use this event to track removing a product from a cart in your mobile application.

Action name of the generated event: product.removeFromCart

Example:

UnitPrice unitPrice = new UnitPrice(price, Currency.getInstance(Locale.US));
RemovedFromCartEvent event = new RemovedFromCartEvent("label", "sku", unitPrice, 1);
Tracker.send(event);
val unitPrice = UnitPrice(price, Currency.getInstance(Locale.US))
val event = RemovedFromCartEvent("label", "sku", unitPrice, 1)
Tracker.send(event)
let regularPrice: UnitPrice = UnitPrice(amount: 200)
let discountedPrice: UnitPrice = UnitPrice(amount: 100)
let finalPrice: UnitPrice = UnitPrice(amount: 100)

let event: ProductRemovedFromCartEvent = ProductRemovedFromCartEvent(label: "LABEL", sku: "SKU12345", finalPrice: finalPrice, quantity: 1)
event.setName("PRODUCT_NAME")
event.setCategory("PRODUCT_CATEGORY")
event.setCategories(["PRODUCT_CATEGORY_1", "PRODUCT_CATEGORY_2"])
event.setProducer("PRODUCT_PRODUCER")
event.setOffline(false)
event.setRegularPrice(regularPrice)
event.setDiscountedPrice(discountedPrice)
event.setURL(URL(string: "URL")!)

Tracker.send(event)
SNRProductRemovedFromCartEvent *event = [[SNRProductRemovedFromCartEvent alloc] initWithLabel:@"LABEL" sku:@"SKU12345" finalPrice:finalPrice quantity:1];
[event setName:@"PRODUCT_NAME"];
[event setCategory:@"PRODUCT_CATEGORY"];
[event setCategories:@[@"PRODUCT_CATEGORY_1", @"PRODUCT_CATEGORY_2"]];
[event setProducer:@"PRODUCT_PRODUCER"];
[event setOffline:NO];
[event setRegularPrice:regularPrice];
[event setDiscountedPrice:discountedPrice];
[event setURL:[NSURL URLWithString:@"URL"]];

[SNRTracker send:event];
var object: Object = {
    campaign: 'Computer bargain',
    lastTo: 'December',
  }

  let price = new UnitPrice(10, 'PLN')
let removedFromCartEvent = new RemovedFromCartEvent('Cart Label', '12345', price, 15, object)
Synerise.Tracker.send(removedFromCartEvent)
UnitPrice unitPrice = UnitPrice(price, 'PLN');
ProductRemovedFromCartEvent event = ProductRemovedFromCartEvent('label', 'sku', unitPrice, 1, {});
Synerise.tracker.send(event);
OS Event Required fields
Android RemovedFromCartEvent Label, Sku, FinalPrice, Quantity
iOS ProductRemovedFromCartEvent Label, SKU, FinalPrice, Quantity
React Native ProductRemovedFromCartEvent Label, SKU, FinalPrice, Quantity
Flutter ProductRemovedFromCartEvent Label, SKU, FinalPrice, Quantity

Recommendation viewed

Use this event to track when a recommendation is displayed to a customer.

Action name of the generated event: recommendation.view

For iOS and Android only: If you use the Widget to present recommendations, this event is tracked automatically.

Example:

List<String> items = Arrays.asList("PRODUCT_ID_1", "PRODUCT_ID_2!");
RecommendationViewEvent event = new RecommendationViewEvent("LABEL", items, "12345", "1234", "corr", params)

Tracker.send(event)
val items = listOf("PRODUCT_ID_1", "PRODUCT_ID_2")
val event = RecommendationViewEvent("LABEL", items, "12345", "1234", "corr", params)

Tracker.send(event)
let event = RecommendationViewEvent(label: "LABEL", campaignID: "1234", campaignHash: "1234", correlationId: "corr", params: nil)
event.setItems([
  "PRODUCT_ID_1",
  "PRODUCT_ID_2"
])
  
Tracker.send(event)
RecommendationViewEvent *event = [[RecommendationViewEvent alloc] initWithLabel:@"LABEL" campaignID:(NSString *)campaignID campaignHash:(NSString *)campaignHash correlationId:(NSString *)correlationId andParams:(nullable SNRTrackerParams *)params];
[event setItems:@[
  @"PRODUCT_ID_1",
  @"PRODUCT_ID_2"
]];

[SNRTracker send:event];
List<String> items = ['PRODUCT_ID_1', 'PRODUCT_ID_2!'];
RecommendationViewEvent event = RecommendationViewEvent('LABEL', '12345', items, '213', '234', 'corr', {});
Synerise.tracker.send(event);
OS Event Required fields
Android RecommendationViewEvent Label, items OR ProductId and Name, CampaignId, CampaignHash
iOS RecommendationViewEvent Label, items, Name, CampaignId, CampaignHash
Flutter RecommendationViewEvent Label, items, Name, CampaignId, CampaignHash

Recommendation seen


This is a legacy event. You should use recommendation.view instead.

Use this event to track recommendation display to a customer.

Action name of the generated event: recommendation.seen

For iOS and Android only: If you use the Widget to present recommendations, this event is tracked automatically.

Example:

RecommendationSeenEvent event = new RecommendationSeenEvent("label", "productId", "productName", "campaignId", "campaignHash");
Tracker.send(event);
val event = RecommendationSeenEvent("label", "productId", "productName", "campaignId", "campaignHash")
Tracker.send(event)
let event: RecommendationSeenEvent = RecommendationSeenEvent(label: "LABEL", productName: "PRODUCT_NAME", productId: "12345", campaignID: "12345", campaignHash: "CAMPAIGN_HASH", params: nil)
event.setCategory("PRODUCT_CATEGORY")
event.setURL(URL(string: "PRODUCT_URL")!)

Tracker.send(event)
SNRRecommendationSeenEvent *event = [[SNRRecommendationSeenEvent alloc] initWithLabel:@"LABEL" productName:@"PRODUCT_NAME" productId:@"12345" campaignID:@"12345" campaignHash:@"CAMPAIGN_HASH" andParams:nil];
[event setCategory:@"PRODUCT_CATEGORY"];
[event setURL:[NSURL URLWithString:@"PRODUCT_URL"]];

[SNRTracker send:event];
var object: Object = {
    product: 'computer',
    screenSize: 15,
  }

let eventSeen = new RecommendationSeenEvent('Recommendation.ts Seen label', '12351', 'Nike Boots', '12345', 'test', object)
Synerise.Tracker.send(eventSeen)
RecommendationSeenEvent event = RecommendationSeenEvent('label', 'productId', 'productName', 'campaignId', 'campaignHash',{});
Synerise.tracker.send(event);
OS Event Required fields
Android RecommendationSeenEvent Label, ProductId,Name, CampaignId, CampaignHash
iOS RecommendationSeenEvent Label, ProductId, Name, CampaignId, CampaignHash
React Native RecommendationSeenEvent Label, ProductId, Name, CampaignId, CampaignHash
Flutter RecommendationSeenEvent Label, ProductId, Name, CampaignId, CampaignHash

Recommendation clicked


Use this event to track recommendation clicks.

Action name of the generated event: recommendation.click

For iOS and Android only: If you use the Widget to present recommendations, this event is tracked automatically.

Example:

RecommendationClickEvent event = new RecommendationClickEvent("label", "productId", "productName", "campaignId", "campaignHash");
Tracker.send(event);
val event = RecommendationClickEvent("label", "productId", "productName", "campaignId", "campaignHash")
Tracker.send(event)
let event: RecommendationClickEvent = RecommendationClickEvent(label: "LABEL", productName: "PRODUCT_NAME", productId: "12345", campaignID: "12345", campaignHash: "CAMPAIGN_HASH", params: nil)
event.setCategory("PRODUCT_CATEGORY")
event.setURL(URL(string: "PRODUCT_URL")!)

Tracker.send(event)
SNRRecommendationClickEvent *event = [[SNRRecommendationClickEvent alloc] initWithLabel:@"LABEL" productName:@"PRODUCT_NAME" productId:@"12345" campaignID:@"12345" campaignHash:@"CAMPAIGN_HASH" andParams:nil];
[event setCategory:@"PRODUCT_CATEGORY"];
[event setURL:[NSURL URLWithString:@"PRODUCT_URL"]];

[SNRTracker send:event];
var object: Object = {
    product: 'computer',
    screenSize: 15,
  }

let event = new RecommendationClickEvent('Recommendation.ts Click label', '12351', 'Boots', '12345', 'test')
Synerise.Tracker.send(event)
RecommendationClickEvent event = RecommendationClickEvent('label', 'productId', 'productName', 'campaignId', 'campaignHash', {});
Synerise.tracker.send(event);
OS Event Required fields
Android RecommendationClickEvent Label, ProductId,Name, CampaignId, CampaignHash
iOS RecommendationClickEvent Label, ProductId, Name, CampaignId, CampaignHash
React Native RecommendationClickEvent Label, ProductId, Name, CampaignId, CampaignHash
Flutter RecommendationClickEvent Label, ProductId, Name, CampaignId, CampaignHash

Customer appeared in location


Use this event to track a customer's presence at a location by passing geographic coordinates.

  1. Send a silent push with the Synerise command GET_LOCATION.
  2. SDK retrieves the location.
  3. Use the data from the GET_LOCATION response to send the AppearedInLocation event.

Action name of the generated event: client.location

Appeared in location event sent after sending silent notification
The "appeared in location" event is sent after a silent push

Example:

AppearedInLocationEvent event = new AppearedInLocationEvent("label", 48.1599, 11.5761);
Tracker.send(event);
val event = AppearedInLocationEvent("label", 48.1599, 11.5761)
Tracker.send(event)
let latitude: CLLocationDegrees = CLLocationDegrees(52.237049)
let longitude: CLLocationDegrees = CLLocationDegrees(21.017532)
let location: CLLocation = CLLocation(latitude: latitude, longitude: longitude)

let event: AppearedInLocationEvent = AppearedInLocationEvent(label: "LABEL", location: location)

Tracker.send(event)
CLLocationDegrees latitude = 52.237049;
CLLocationDegrees longitude = 21.017532;
CLLocation *location = [[CLLocation alloc] initWithLatitude:latitude longitude:longitude];

SNRAppearedInLocationEvent *event = [[SNRAppearedInLocationEvent alloc] initWithLabel:@"LABEL" andLocation:location];

[SNRTracker send:event];
var object: Object = {
    number: 5,
  }

  let event = new AppearedInLocationEvent('Hit Timer Event Label', 10, 20, object)

  Synerise.Tracker.send(event)
AppearedInLocationEvent event = AppearedInLocationEvent('label', 48.1599, 11.5761, {});
Synerise.tracker.send(event);
OS Event Required fields
Android AppearedInLocationEvent Label, Latitude, Longitude
iOS AppearedInLocationEvent Label, Latitude, Longitude
React Native AppearedInLocationEvent Label, Latitude, Longitude
Flutter AppearedInLocationEvent Label, Latitude, Longitude

Customer activity timer


Use this event to measure the duration of any customer activity - send Hit timer when a customer starts an activity and send it again with a different time signature when the customer finishes. After that, you can use the Decision Hub to measure, for example, average activity time. You can add a custom parameter to the timer events so you can recognize them.

Action name of the generated event: client.hitTimer

Example:

HitTimerEvent event = new HitTimerEvent("label");
Tracker.send(event);
val event = HitTimerEvent("label")
Tracker.send(event)
let event: HitTimerEvent = HitTimerEvent(label: "LABEL")

Tracker.send(event)
SNRHitTimerEvent *event = [[SNRHitTimerEvent alloc] initWithLabel:@"LABEL"];
    
[SNRTracker send:event];
let sendHitTimerEvent = function() {

  var object: Object = {

    timer: 'anti-clockwise',

    number: 5,

  }



  let event = new HitTimerEvent('Hit Timer Event Label', object)



  Synerise.Tracker.send(event)
HitTimerEvent event = HitTimerEvent('label',{});
Synerise.tracker.send(event);
OS Event Required fields
Android HitTimerEvent Label
iOS HitTimerEvent Label
React Native HitTimerEvent Label
Flutter HitTimerEvent Label

Customer searched


Use this event to track search queries - every time a customer types a query in the search box in your mobile application, this event will be generated.

Action name of the generated event: client.search

Example:

SearchedEvent event = new SearchedEvent("label");
Tracker.send(event);
val event = SearchedEvent("label")
Tracker.send(event)
let event: SearchedEvent = SearchedEvent(label: "LABEL")
        
Tracker.send(event)
SNRSearchedEvent *event = [[SNRSearchedEvent alloc] initWithLabel:@"LABEL"];
    
[SNRTracker send:event];
var object: Object = {
    timer: 'anti-clockwise',
    number: 5,
  }

  let event = new HitTimerEvent('Hit Timer Event Label', object)

  Synerise.Tracker.send(event)
SearchedEvent event = SearchedEvent('label', {});
Synerise.tracker.send(event);
OS Event Required fields
Android SearchedEvent Label
iOS SearchedEvent Label
React Native SearchedEvent Label
Flutter SearchedEvent Label

Customer shared


Use this event to track customer sharing something from your application.

Action name of the generated event: client.shared

Example:

SharedEvent event = new SharedEvent("label");
Tracker.send(event);
val event = SharedEvent("label")
Tracker.send(event)
let event: SharedEvent = SharedEvent(label: "LABEL")

Tracker.send(event)
SNRSharedEvent *event = [[SNRSharedEvent alloc] initWithLabel:@"LABEL"];
    
[SNRTracker send:event];
var object: Object = {
    sharedEvents: '5',
    field: 'test',
  }

  let event = new SharedEvent('Shared Event Label', object)

  Synerise.Tracker.send(event)
SharedEvent event = new SharedEvent('label',{});
Synerise.tracker.send(event);
OS Event Required fields
Android SharedEvent Label
iOS SharedEvent Label
React Native SharedEvent Label
Flutter SharedEvent Label

Customer visited a screen


This event is used when a customer visits a particular screen in your application.

Action name of the generated event: screen.view

Event sent when a user visits a screen
Event sent when a mobile app user visits a screen

Example:

VisitedScreenEvent event = new VisitedScreenEvent("label");
Tracker.send(event);
val event = VisitedScreenEvent("label")
Tracker.send(event)
let event: VisitedScreenEvent = VisitedScreenEvent(label: "LABEL")

Tracker.send(event)
SNRVisitedScreenEvent *event = [[SNRVisitedScreenEvent alloc] initWithLabel:@"LABEL"];
    
[SNRTracker send:event];
let sendVisitedScreenEvent = function() {

  var object: Object = {

    screen: '1',

    age: '25',

  }



  let event = new VisitedScreenEvent('Visited Screen label', object)



  Synerise.Tracker.send(event)
VisitedScreenEvent event = VisitedScreenEvent('label', {});
Synerise.tracker.send(event);
OS Event Required fields
Android VisitedScreenEvent Label
iOS VisitedScreenEvent Label
React Native VisitedScreenEvent Label
Flutter VisitedScreenEvent Label

Crash Event


This event is used when the application crashes.

The event is sent automatically by Synerise SDK when you enable crash handling while configuring the SDK.

You can send it by yourself when you handle an uncaught exception.

Action name of the generated event: client.applicationCrashed

Example:

let event: CrashEvent = CrashEvent(label: "LABEL")
event.setExceptionName("EXCEPTION_NAME")
event.setExceptionReason("EXCEPTION_REASON")
event.setExceptionStacktrace("EXCEPTION_STACKTRACE")

Tracker.send(event)
SNRCrashEvent *event = [[SNRCrashEvent alloc] initWithLabel:@"LABEL"];
[event setExceptionName:@"EXCEPTION_NAME"];
[event setExceptionReason:@"EXCEPTION_REASON"];
[event setExceptionStacktrace:@"EXCEPTION_STACKTRACE"];

[SNRTracker send:event];
OS Event Required fields
Android CrashEvent Label
iOS CrashEvent Label
React Native n/a Label
Flutter n/a Label

Push viewed


Use this event to track viewing a push notification.

Push events are tracked automatically for Android and React Native (if the notifications have been configured for React Native according to iOS or Android ).

Action name of the generated event: push.view

let event: PushViewedEvent = PushViewedEvent(label: "LABEL")

Tracker.send(event)
SNRPushViewedEvent *event = [[SNRPushViewedEvent alloc] initWithLabel:@"LABEL"];
    
[SNRTracker send:event];
PushViewedEvent event = PushViewedEvent('label', {});
Synerise.tracker.send(event);
OS Event Required fields
Android PushViewedEvent Label
iOS PushViewedEvent Label
React Native PushViewedEvent Label
Flutter PushViewedEvent Label

Push clicked


Use this event to track tapping a push notification.

Push events are tracked automatically for Android and React Native (if the notifications have been configured for React Native according to iOS or Android ).

Action name of the generated event: push.click

let event: PushClickedEvent = PushClickedEvent(label: "LABEL")

Tracker.send(event)
SNRPushClickedEvent *event = [[SNRPushClickedEvent alloc] initWithLabel:@"LABEL"];
    
[SNRTracker send:event];
PushClickedEvent event = PushClickedEvent('label', {});
Synerise.tracker.send(event);
OS Event Required fields
Android ClickedPushEvent Label
iOS PushClickedEvent Label
React Native ClickedPushEvent Label
Flutter PushClickedEvent Label

Push cancelled


Use this event to track dismissing push notifications.

Push events are tracked automatically for Android and React Native (if the notifications have been configured for React Native according to iOS or Android ).

Action name of the generated event: push.dismiss

let event: PushCancelledEvent = PushCancelledEvent(label: "LABEL")

Tracker.send(event)
SNRPushCancelledEvent *event = [[SNRPushCancelledEvent alloc] initWithLabel:@"LABEL"];
    
[SNRTracker send:event];
PushCancelledEvent event = PushCancelledEvent('label', {});
Synerise.tracker.send(event);
OS Event Required fields
Android CancelledPushEvent Label
iOS PushCancelledEvent Label
React Native PushCancelledEvent Label
Flutter PushCancelledEvent Label

Canonical URL: https://hub.synerise.com/developers/mobile-sdk/event-tracking