To connect MyTracker Personalize to the mobile app,
set up event sending through the MyTracker SDK and connect the Personalize API.
Integrate MyTracker SDK
MyTracker SDK collects stats on each app user
and generates the base needed to build recommendations.
Connect SDK to the app that the user will interact with.
For details, refer to sections iOS,
Android,
Unity.
Ensure you configure the payment tracking and payment verification.
For details,
refer to the Purchase tracking section.
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 does not 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
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.
The placement_id, sku, and payload parameters
should be specified when creating a recommendation in MyTracker.
Learn more
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 is not unique and can be used for several offers in the store)
"com.app.10dollars"
payload**
Unique offer 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.
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
Through requests to the Personalize API,
you can receive real-time recommendations and display personalized offers within the app.
Request sending
Check out the specifics of sending requests:
You should send a request from different platforms (iOS, Android, Unity) separately,
each with its sdk_key.
To get sdk_key,
embedded SDK to your app.
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.
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).
A flag changing the answer format. Possible values:
0 — the data field is a dictionary
1 — the data field is an array
Default value: 0
Boolean
0
reset
A sign of resetting recommendations on subsequent requests. Possible values:
0 — do not reset
1 — reset
Default value: 1
Boolean
1
placement_ids
Offer placement identifiers.
If the parameter is not specified,
the recommendation will be generated for all offer placement
String array
A, B, C
* — required parameter.
Examples of queries
Example query:
curl --location --request GET 'https://mlapi.tracker.my.com/api/v1/recommendation/item?sdk_key=00001234567890123456&custom_user_id=1234&placement_ids=A&placement_ids=B&placement_ids=C'
group_id: group identifier to which the user belongs:
group for recommendations or control group
placement_id: offer placement identifier
offer_id: offer identifier
price: default price of the offer (not required to use)
value: default value of the offer (not required to use)
discount_price: recommended offer price
discount_value: recommended offer value
Example query with flat=1:
curl --location --request GET 'https://mlapi.tracker.my.com/api/v1/recommendation/set?sdk_key=00001234567890123456&custom_user_id=1234&placement_ids=A&placement_ids=B&placement_ids=C&flat=1'
A flag changing the answer format. Possible values:
0 — the data field is a dictionary
1 — the data field is an array
Default value: 0
Boolean
0
reset
A sign of resetting recommendations on subsequent requests. Possible values:
0 — do not reset
1 — reset
Default value: 1
Boolean
1
placement_ids
Offer placement identifiers.
If the parameter is not specified,
the recommendation will be generated for all offer placement
String array
A, B, C
* — required parameter.
Examples of queries
Example query:
curl --location --request GET 'https://mlapi.tracker.my.com/api/v1/recommendation/set?sdk_key=00001234567890123456&custom_user_id=1234&placement_ids=A&placement_ids=B&placement_ids=C'
curl --location --request GET 'https://mlapi.tracker.my.com/api/v1/recommendation/set?sdk_key=00001234567890123456&custom_user_id=1234&placement_ids=A&placement_ids=B&placement_ids=C&flat=1'