Connect MyTracker Personalize

To connect MyTracker Personalize to mobile app and run personalized recommendations for users, follow three steps:

  1. Integrate MyTracker SDK
  2. Configure recommendations
  3. Integrate Personalize API

1. Integrate MyTracker SDK

MyTracker SDK collects stats on each app user and generates the base needed to build recommendations.

  1. Connect SDK to the app that the user will interact with. For details, refer to sections iOS, Android, Unity.
  2. Ensure you configure the purchase tracking and payment verification. For details, refer to the Purchase tracking section.
  3. Choose a user identification method:
    • If your application requires registration, and each user has a unique identifier, then configure user tracking with the parameter customUserId (see sections for iOS, Android, Unity).
    • customUserId should not change since the first launch of the application

    • If your application doesn't require registration or users do not have a unique identifier right after the first launch, you should use instanceId (see sections for iOS, Android, Unity) and pass instanceId in the customUserId parameter.
    • instanceId identifies the physical device but not the user, so the recommendation for the same user may be different on different platforms


  4. According to the instructions for events with a custom name (for iOS, Android, Unity), set the following events to be sent:
    • Offer trigger offer_trigger
    • Purchase of offer purchase_offer
    • Opening/closing an offer card offer_card
    • User account status account_status

    All events should be sent from the device (not the server). To not accumulate events in the buffer, we recommend specifying the flush parameter when you send events (see instruction for the force sending events for iOS, Android, Unity).

    All event parameters should be passed as a string; the decimal separator for real numbers should be a point.

    Events details are given below.

Offer trigger

You should send the offer_trigger event when a user falls under or drops out of the offer display condition (for example, start/end of the promotion in the app).

Event parameters should be passed as a string:

Name Description Example
action* "start" if a user falls under the offer display condition
"end" if a user drops out of condition
"start"
placement_id* Offer placement identifier "A"
sku** Name of the bundle in the store (it may not be unique for the store item) "com.app.10dollars"
payload** Unique item name within the application "offer.for.unpaid"
timestamp* Event timestamp (UTC+3 in seconds) "1597316958"

* — required parameter.

** — required parameter for the item recommendation and optional for the set recommendation.

Example:

let eventCustomParams = [
    "action": "start",
    "placement_id": "A",
    "payload": "offer.for.unpaid",
    "timestamp": "1597316958"
]
MRMyTracker.trackEvent(withName: "offer_trigger", eventParams:eventCustomParams)
val eventCustomParams = HashMap<String, String>()
    eventCustomParams["action"] = "start";
    eventCustomParams["placement_id"] = "A";
    eventCustomParams["payload"] = "offer.for.unpaid";
    eventCustomParams["timestamp"] = "1597316958";
MyTracker.trackCustomEvent("offer_trigger", eventCustomParams);
var IDictionary<String, String> eventCustomParams = new Dictionary<String, String>();
    eventCustomParams["action"] = "start";
    eventCustomParams["placement_id"] = "A";
    eventCustomParams["payload"] = "offer.for.unpaid";
    eventCustomParams["timestamp"] = "1597316958";
MyTracker.TrackEvent("offer_trigger", eventCustomParams));

Purchase offer

You should send the purchase_offer event right after a user makes a purchase/attempts to purchase an item involved in the recommendation.

If the purchase has more than one item, you should send each item in a separate event.

Event parameters should be passed as a string:

Name Description Example
placement_id* Offer placement identifier "A"
placement_type Type of the offer card placement (it can be a different application screens).

Default value: "any"
"main"
"store"
"pop-up"
sku* Name of the bundle in the store (it may not be unique for the store item) "com.app.10dollars"
payload* Unique item name within the application "offer.for.unpaid"
result* Purchase success (debit) "true"
"false"
offer_id* Offer identifier "42"
timestamp* Purchase timestamp (UTC+3 in seconds) "1597316958"

* — required parameter.

let eventCustomParams = [
    "placement_id":"A",
    "placement_type":"store",
    "sku": "com.app.10dollars",
    "payload": "offer.for.unpaid",
    "result": "true",
    "offer_id": "42",
    "timestamp":"1597316958"
]
MRMyTracker.trackEvent(withName: "purchase_offer", eventParams:eventCustomParams)
val eventCustomParams = HashMap<String, String>()
    eventCustomParams["placement_id"] = "A";
    eventCustomParams["placement_type"] = "store";
    eventCustomParams["sku"] = "com.app.10dollars";
    eventCustomParams["payload"] = "offer.for.unpaid";
    eventCustomParams["result"] = "true";
    eventCustomParams["offer_id"] = "42";
    eventCustomParams["timestamp"] = "1597316958";
MyTracker.trackCustomEvent("purchase_offer", eventCustomParams);
var IDictionary<String, String> eventCustomParams = new Dictionary<String, String>();
    eventCustomParams["placement_id"] = "A";
    eventCustomParams["placement_type"] = "store";
    eventCustomParams["sku"] = "com.app.10dollars";
    eventCustomParams["payload"] = "offer.for.unpaid";
    eventCustomParams["result"] = "true";
    eventCustomParams["offer_id"] = "42";
    eventCustomParams["timestamp"] = "1597316958";
MyTracker.TrackEvent("purchase_offer", eventCustomParams));

Opening/Closing card

You should send the offer_card every time a user opens/closes the card/screen of the offer involved in the recommendation.

Event parameters should be passed as a string:

Name Description Example
action* Action with an offer card: "open" or "close". If a user opened and closed a card, you should send a separate event with different actions. "open"
placement_id* Offer placement identifier "A"
placement_type Type of the offer card placement (it can be a different application screens).

Default value: "any"
"main"
"store"
"pop-up"
sku** Name of the bundle in the store (it may not be unique for the store item) "com.app.10dollars"
payload** Unique item name within the application "offer.for.unpaid"
offer_id* Offer identifier "42"
timestamp* Timestamp for opening/closing an offer card (UTC+3 in seconds) "1597316958"

* — required parameter.

** — required parameter for the item recommendation and optional for the set recommendation.

let eventCustomParams = [
    "action": "open",
    "placement_id": "A",
    "placement_type": "store",
    "sku": "com.app.10dollars",
    "payload": "offer.for.unpaid",
    "offer_id": "42",
    "timestamp":"1597316958"
]
MRMyTracker.trackEvent(withName: "offer_card", eventParams:eventCustomParams)
val eventCustomParams = HashMap<String, String>()
    eventCustomParams["action"] = "open";
    eventCustomParams["placement_id"] = "A";
    eventCustomParams["placement_type"] = "store";
    eventCustomParams["sku"] = "com.app.10dollars";
    eventCustomParams["payload"] = "offer.for.unpaid";
    eventCustomParams["offer_id"] = "42";
    eventCustomParams["timestamp"] = "1597316958";
MyTracker.trackCustomEvent("offer_card", eventCustomParams);
var IDictionary<String, String> eventCustomParams = new Dictionary<String, String>();
    eventCustomParams["action"] = "open";
    eventCustomParams["placement_id"] = "A";
    eventCustomParams["placement_type"] = "store";
    eventCustomParams["sku"] = "com.app.10dollars";
    eventCustomParams["payload"] = "offer.for.unpaid";
    eventCustomParams["offer_id"] = "42";
    eventCustomParams["timestamp"] = "1597316958";
MyTracker.TrackEvent("offer_card", eventCustomParams));

Account status

You should send the account_status at least every time the application is launched.

The table below shows general parameters that can characterize the account status. Try to find an analog in your application for the maximum number of parameters listed. To add more parameters, contact our support team.

Event parameters should be passed as a string:

Name Description Example
in_game_currency_<name> Any balances of in-game resources, where name is a resource name "444"
in_game_currency_diamonds Any balances of in-game resources, such as diamonds "5"
in_game_currency_food Any balances of in-game resources, such as food "5"
in_game_currency_gold Any balances of in-game resources, such as gold "5"
account_level Account level "5"
clan Clan identifier "123123123",
"0" — not in a clan
achievements_count Achievements count "12"
ranking Account ranking "99"
power Account power "12312312"
friends_count Friends count "56"
matches_count Matches count "21312"
wins_count Wins count "12121"
timestamp* Event timestamp (UTC+3 in seconds) "1597316958"

* — required parameter.

let eventCustomParams = [
    "in_game_currency_diamonds": "5",
    "in_game_currency_food": "10001",
    "in_game_currency_gold": "356",
    "account_level": "5",
    "clan": "123123123",
    "achievements_count": "12",
    "ranking": "99",
    "power": "12312312",
    "friends_count": "56",
    "matches_count": "21312",
    "wins_count": "12121",
    "timestamp": "1597316958"
]
MRMyTracker.trackEvent(withName: "account_status", eventParams:eventCustomParams)
val eventCustomParams = HashMap<String, String>()
    eventCustomParams["in_game_currency_diamonds"] = "5";
    eventCustomParams["in_game_currency_food"] = "10001";
    eventCustomParams["in_game_currency_gold"] = "356";
    eventCustomParams["account_level"] = "5";
    eventCustomParams["clan"] = "123123123";
    eventCustomParams["achievements_count"] = "12";
    eventCustomParams["power"] = "12312312";
    eventCustomParams["friends_count"] = "56";
    eventCustomParams["matches_count"] = "21312";
    eventCustomParams["wins_count"] = "12121";
    eventCustomParams["timestamp"] = "1597316958";
MyTracker.trackCustomEvent("account_status", eventCustomParams);
var IDictionary<String, String> eventCustomParams = new Dictionary<String, String>();
    eventCustomParams["in_game_currency_diamonds"] = "5";
    eventCustomParams["in_game_currency_food"] = "10001";
    eventCustomParams["in_game_currency_gold"] = "356";
    eventCustomParams["account_level"] = "5";
    eventCustomParams["clan"] = "123123123";
    eventCustomParams["achievements_count"] = "12";
    eventCustomParams["power"] = "12312312";
    eventCustomParams["friends_count"] = "56";
    eventCustomParams["matches_count"] = "21312";
    eventCustomParams["wins_count"] = "12121";
    eventCustomParams["timestamp"] = "1597316958";
MyTracker.TrackEvent("account_status", eventCustomParams));

2. Configure recommendations

Contact MyTracker team to configure recommendations:

You can contact team in any convenient way

  1. Select the metric you are trying to improve, for example, APRU or CR. You can use it to evaluate the effectiveness of using the recommendations.
  2. Select the offer you need to recommend: a single item or a set of items.
  3. Select the target audience you need to send recommendations:
    • all app users
    • audience segment, specified by several parameters (see the Segments section)
    • audiences that cannot be specified with a segment (in this case, you can provide a verbal description of the target audience)
  4. Determine all possible offers from which MyTracker Personalize will select recommendations. The following fields should describe each offer:
    • offer_id — offer identifier that matches the sku+payload pair (offer_id should be the one sent in custom events).
    • sku — offer identifier in the store (sku matches the offer price in the store ).
    • payload — unique internal offer name in the application.

    With all possible offers variants, you should pass a reserve variant, which parameters should be identical to the control

    For example, three offer variants for item:
    offer_id sku payload Control variant, shown by default
    "0" "com.app.id.1" "offer.for.unpaid" yes (reserve)
    "1" "com.app.id.1" "offer.for.unpaid" yes
    "2" "com.app.id.2" "offer.for.unpaid" no
    "3" "com.app.id.3" "offer.for.unpaid" no
    For example, three offer variants for set:
    offer_id sku payload Control variant, shown by default
    "0" subscription_month "month" yes (reserve)
    "0" subscription_year "year" yes (reserve)
    "0" subscription_forever "forever" yes (reserve)
    "1" subscription_month "month" yes
    "1" subscription_year "year" yes
    "1" subscription_forever "forever" yes
    "2" subscription_month "month" no
    "2" subscription_year "year" no
    "2" subscription_forever "forever" no
    "3" subscription_month "month" no
    "3" subscription_year "year" no
    "3" subscription_forever "forever" no
  5. Determine the A/B testing parameters:
    • List platforms for testing: iOS, Android.
    • Set the percentage of users to include as control and test groups. For example, you can show the default price for 30% of players and a personalized offer for 70% of players in the Players  10 level segment.
    • Determine the default offer (item or set) to include in the control group.
    • Set the placement identifiers where the offers will be run. Each test should have its own placement_id.
  6. Determine the features of the recommendation:
    • How often we can change the offer price.
    • What is the frequency and duration of recommendations? For example, on a timer, on weekends every week, etc.

3. Integrate Personalize API

Integrate Personalize API to send real-time recommendation requests to the MyTracker server and display personalized offers in the app.

  1. Check the queries:
    • You should send a request from different platforms (iOS, Android, Unity, Flutter) separately, each with its sdk_key. To get sdk_key, embedded SDK to your app.
  2. Choose one of the options for sending requests:
    • From mobile app. In this case, you should better use an asynchronous request for recommendations immediately after loading the application.
    • From mobile app backend. We recommend you do not send requests until the user has accessed the offers so that MyTracker has time to gather as much data as possible. Repeated requests should be made at least once a day.
  3. Consider the following options:
    • Caching the latest recommendations on the client-side. You will be able to give the most current recommendation to the user, even if there is a problem with the network, a delay in getting a recommendation, or an error on the server-side.
    • Asynchronous request sending.
    • Using reset parameter in API requests (optionally). If reset=True, the service gives the user the most recent recommendation (offer price may change). If reset=False, the service returns the last recommendation (the offer price will remain the same).

API documentation see in the Personalize API section

Results

After you connect MyTracker Personalize, app users will receive personalized offers. Depending on the conditions you set, recommended prices may be displayed as a discount or as the default price:



You will receive automatic reports on the results of the A/B test and information about profits from personal recommendations by email, Telegram channel, or any other way convenient for you.