Dynamic remarketing based on mobile events

Dynamic remarketing in myTarget is based on events - user actions on the websites and in the mobile applications of the advertiser. Events are the visiting of pages of sites or screens of mobile applications and performance of target actions on sites and in applications. Event information is used to analyze user behavior and to further show advertisements for exactly those advertiser products that users are interested in.
Events from the site
Initially, the advertiser's site was the basic source of events for dynamic remarketing in myTarget. Using a special JavaScript code Counter Top.Mail.Ru, integrated into the pages of the site, information about events is transmitted to myTarget. To analyze the behavior of users on the site, several basic entities and parameters are used that mark the pages of the site:
  • product - a visit to the product page, the product identifier and its cost are transmitted;
  • cart - a visit to the cart page or adding a product to the cart (pages with a list of products selected by the user), the product identifiers and their total cost are transferred;
  • purchase - a visit to the purchase confirmation page (when the purchase is made), product identifiers and their total cost are transmitted.
Features: The name of the entities (events / pages), information about product identifiers and their total cost is transmitted in the pagetype, productid and totalvalue parameters. The productid parameter must contain the same identifiers as shown in the store's product feed. The totalvalue parameter must always contain the sum of the cost of all products. In addition, the id of the feed to which the product belongs should be specified in the service parameter list.
Example of data transfer (JS-code call on the advertiser's site):
<script type="text/javascript">
var _tmr = _tmr || [];
_tmr.push({
type: 'itemView',
productid: '12345',
pagetype: 'product',
totalvalue: '3499.50',
list: '1'
});
</script>
For more information on dynamic remarketing based on events from sites and on creating product feeds (data source for generating advertisements), see the article.
Events from mobile applications, postbacks from tracking systems to myTarget
In addition to using basic information about users' actions on the site, now the advertiser can use data about events produced by users in his mobile applications (in-app events). As part of the integration of myTarget and the tracking system, the advertiser can configure the transfer of data about mobile events. The tracking system automatically sends information about events and parameters of these events to myTarget in postbacks, according to the settings of the myTarget module in the client's personal account specified by the advertiser.

To analyze user actions and dynamic remarketing campaigns, the following events are required in the mobile application:

  • viewProduct is a product viewing event (product description screen), the product identifier and its cost are transmitted in the event;
  • addToCart — event of adding a product to the cart, or viewing the cart screen (a screen with a list of products selected by the customer), product identifiers, their quantity and cost are transmitted;
  • purchase — the event of the purchase, or viewing the purchase confirmation screen (when the purchase was made), product identifiers, their quantity and cost are transmitted.
Note: Event names must be specified and transmitted it in the form in which they are listed above.
For AppsFlyer, you can set event names only at the SDK level integrated into the advertiser's mobile application.

For Adjust, you can set event names in one of the standard ways - either at the SDK Adjust level integrated into the advertiser's mobile application, or at the Adjust personal account level in the mapping (matching) section of event names and parameters used for postbacks. It is also possible to set rules for matching all event names and some parameters (product identifier, feed identifier) by myTarget, if for some reason the advertiser does not have the ability to specify them in standard ways.

Each event must contain parameters (all or only mandatory):
  • productid — identifier of the product with which the user performed the action (event);
Note: The product identifier must be specified in the same form as in the product feed file. Information on the format of the feed file, its download in the myTarget personal account and the use of dynamic remarketing for advertising campaigns is in the article.
  • value — the current value of one product unit;
  • quantity — the number of units of products in the event;
  • trg_feed — counter identifier Top.Mail.Ru and feed identifier, in the format of <counter ID> _ <feed ID> (for example, 12345_1).
Parameter
Data type
Required
Transmitted in events
productid
string
yes
viewProduct, addToCart, purchase
trg_feed
string
yes
viewProduct, addToCart, purchase
value
string
no
viewProduct, addToCart, purchase
quantity
string
no
addToCart, purchase
Feed product identification — trg_feed parameter
As an advertiser can upload an unlimited number of product feeds into his myTarget account, a unique feed identifier is required when sending each mobile event. This identifier determines which advertiser's feed belongs to the product transmitted in the event (postback by event). The identifier is composed of the Counter ID Top.Mail.Ru (each feed must be tied to the counter) and the ID of the feed assigned by the advertiser.

In general, the trg_feed parameter is used to pass the ID of the feed to which the product belongs — it must be specified in each event. The parameter must contain a value of the form <counter ID> _ <feed ID> (for example, 12345_1). You can get these IDs in myTarget advertiser's personal account.
Adjust Postback Transfer
If the advertiser's mobile application is already integrated with Adjust using the SDK, make sure that the necessary events and parameters for them are generated for dynamic remarketing. The names of events and parameters can be arbitrary, you can set their comparison with the names used in myTarget in your personal account Adjust for each partner individually.

To transfer event parameters to be sent from Adjust to partners (myTarget), use the addPartnerParameter SDK Adjust method.
Note: A description of the addPartnerParameter SDK Adjust method is provided in the official documentation:

SDK for native applications:

SDK for WebView applications:

Settings in the SDK (in the mobile application code)

An example of using the addPartnerParameter method at a viewing event of an application screen about a product (viewProduct event), which has a value of "3499.50 rubles" and an identifier "12345":
SDK for native apps Android:
AdjustEvent event = new AdjustEvent("viewProduct");
event.addPartnerParameter("productid", "10001");
event.addPartnerParameter("value", "3499.50");
event.addPartnerParameter("trg_feed", "12345_1");
Adjust.trackEvent(event);
SDK for native apps iOS:
ADJEvent *event = [ADJEvent eventWithEventToken:@"viewProduct"];
[event addPartnerParameter:@"productid" value:@"10001"];
[event addPartnerParameter:@"value" value:@"3499.50"];
[event addPartnerParameter:@"trg_feed" value:@"12345_1"];
[Adjust trackEvent:event]
SDK for WebView apps Android:
let adjustEvent = new AdjustEvent('viewProduct');
adjustEvent.addPartnerParameter('productid', '10001');
adjustEvent.addPartnerParameter('value', '3499.50');
adjustEvent.addPartnerParameter('trg_feed', '12345_1');
Adjust.trackEvent(adjustEvent);
SDK for WebView apps iOS:
var adjustEvent = new AdjustEvent('viewProduct');
adjustEvent.addPartnerParameter('productid', '10001');
adjustEvent.addPartnerParameter('value', '3499.50');
adjustEvent.addPartnerParameter('trg_feed', '12345_1');
Adjust.trackEvent(adjustEvent);
The transfer of multiple products at the event

If an event involves the transfer of several products, for example, when an application user adds more than one product to the cart, then to transfer event data, they should be divided into several.

An example of using the addPartnerParameter method for a basket screen view event (addToCart event - can be used both when adding goods to the cart and when viewing the contents of the cart) to which the user added two products in different quantities:
SDK for native apps Android:
AdjustEvent event = new AdjustEvent("addToCart");
event.addPartnerParameter("productid", "10001");
event.addPartnerParameter("value", "499.05");
event.addPartnerParameter("quantity", "1");
event.addPartnerParameter("trg_feed", "12345_1");
Adjust.trackEvent(event);
 
AdjustEvent event = new AdjustEvent("addToCart");
event.addPartnerParameter("productid", "10002");
event.addPartnerParameter("value", "145.75");
event.addPartnerParameter("quantity", "3");
event.addPartnerParameter("trg_feed", "12345_1");
Adjust.trackEvent(event);

Settings in the adjust account

To send data about events and parameters that are transferred from the mobile application to Adjust and that are intended for transmission to partners, to myTarget, enable sending postbacks, specify a list of transmitted events and, if necessary, perform a mapping of event names and parameters.
Please note: The instructions below are required to be executed regardless of the names of events and parameters used in the mobile application.
The sequence of actions in the Personal Account Adjust:

1. Add partner myTarget in the application settings, if not already added, and enable the transfer of events and parameters:
  • Go to the "All Settings" section of the application;
  • In the side menu, select "Partner Setup", click "Add Partners" (see screenshot 1 - step 1)
Screenshot 1
  • Specify "myTarget" in the search bar (see screenshot 2 - step 1), click plus (see screenshot 2 - step 2)
Screenshot 2
  • Set the "Enabled" and "Parameter Forwarding" switches to the "On" state (see screenshot 3 - steps 1 and 2);
Note: If your application in Adjust is set up as multiplatform, then you need to enable the "Enabled" and "Parameter Forwarding" switches for both the iOS version of the application and Android. The same conditions apply to the sections "Event Linking" and "Partner Parameter Mapping", instructions for setting up which are presented below.

  • Click "Save" (see screenshot 3 - step 3).
Screenshot 3
2. Set up the transmission of events, set the rules for matching the names of events:
  • After adding a partner in the "Partner Setup" section the item "myTarget" will be displayed, select it;
  • Go to the "Event Linking" section - select those SDK events that correspond to the events required for dynamic remarketing, and give them the appropriate names (see screenshot 4 - steps 1 to 3), click the "Ok" button (see screenshot 4 - step 4), then the "Save" button.

Note: The names of events that should be specified are described in the section "Events from mobile applications, postbacks from tracking systems to myTarget". In the postbacks from Adjust to myTarget, will be transmitted only those events, which names is explicitly specified in the "Event Linking" section, therefore, regardless of whether the application uses the event names required for dynamic remarketing or not, you must specify the names in the empty lines opposite events from applications - otherwise events will not be transmitted. If you want events to be sent with the original names used in the SDK, specify these names as is.
Screenshot 4
3. Configure the transmission of event parameters - name matching:
  • In the "Partner Setup" section, select "myTarget", then select the "Partner Parameter Mapping" section;
  • Specify the names of the parameters used in the SDK and give them the names necessary for dynamic remarketing (see screenshot 5 - steps 1 and 2);
  • Click "Save" (see screenshot 5 - step 3).


Note: The names of the parameters used in dynamic remarketing are described in the section "Events from mobile applications, postbacks from tracking systems to myTarget". If the parameter names used in the SDK for the events required for dynamic remarketing correspond to those used in myTarget, then there is no need to fill in the correspondence table in the section "Partner Parameter Mapping". Adjust automatically transfers all event parameters with their original names if the transmission of these events is enabled, and the "Parameter Forwarding" switch is set to "On".
Screenshot 5
AppsFlyer Postback Transfer
If the advertiser's mobile application is already integrated with AppsFlyer using the SDK, make sure that the necessary events and parameters for them are generated for dynamic remarketing. You can use your own or standard event names and AppsFlyer parameters - in this case, you can set a comparison of all names and some parameters (product identifier, feed identifier) from the side of myTarget. But we recommend using the names of events and myTarget parameters - in this case, no mapping will be required, the data necessary for dynamic remarketing will be immediately transferred to myTarget.

To transfer event parameters intended for sending from AppsFlyer to partners (myTarget), use the trackEvent SDK AppsFlyer method.
Note: the description of the trackEvent SDK AppsFlyer method is provided in the official documentation:

Settings in the SDK (in the mobile application code)

An example of using the trackEvent method on a viewing event of an application screen about a product (viewProduct event), which has a value of "3499.50 rubles" and an identifier "12345":
SDK for Android:
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put("productid","10001");
eventValue.put("value","3499.50");
eventValue.put("quantity","1");
eventValue.put("trg_feed","12345_1");
AppsFlyerLib.getInstance().trackEvent(context,"viewProduct",eventValue);
Note: The example shows the use of event names and myTarget parameters. This is the most preferred method that does not require additional actions to match names and parameters on the side of myTarget.

A similar example of calling the trackEvent method on the basis of the af_content_view universal event AppsFlyer, but supplemented by passing the trg_feed parameter below.
SDK for Android:
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.CONTENT_ID, "10001";
eventValue.put("trg_feed","12345_1");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext(), AFInAppEventType.CONTENT_VIEW, eventValue);
Pay attention: The example uses the universal event AppsFlyer, which means that its name will be passed to myTarget as af_content_view, and the product ID will be passed as af_content_id. Since you cannot set the mapping of event names and parameters to the names used in myTarget on the AppsFlyer side, you will need to set a mapping on the myTarget side. To do this, submit the appropriate application, the instruction is described in the section "Processing postbacks about events in myTarget".

Note: The description of the standard af_content_view event is provided in the AppsFlyer documentation - the "Content View" item. In turn, the items "Add to Cart" and "Purchase" describe the use of standard af_add_to_cart and af_purchase events - read them if you plan to use standard events, and not events with the names myTarget.
The transfer of multiple products at the event

If an event involves the transfer of several products, for example, when an application user adds more than one product to the basket, then they should be divided into several to transfer event data.

An example of using the trackEvent method for a cart screen view event (myTarget addToCart event — can be used both when adding a product to the cart and when viewing the contents of the cart) to which the user added two products in different quantities:
SDK for native apps Android:
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put("productid","10001");
eventValue.put("value","499.05");
eventValue.put("quantity","1");
eventValue.put("trg_feed","12345_1");
AppsFlyerLib.getInstance().trackEvent(context,"addToCart",eventValue);
 
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put("productid","10002");
eventValue.put("value","145.75");
eventValue.put("quantity","3");
eventValue.put("trg_feed","12345_1");
AppsFlyerLib.getInstance().trackEvent(context,"addToCart",eventValue);
Note: SDK AppsFlyer allows you to use multiple values and complex postbacks on events, to transfer data on several products in one event, but in the current implementation of event accounting in myTarget, such values are not processed. The possibility of their use will be added in the future.

Settings in the AppsFlyer account

To transfer event and parameter data from the mobile application to AppsFlyer to myTarget, you must enable postback sending and set the list of transmitted events.

The sequence of actions in your personal account AppsFlyer:

  • Go to the "Integrated Partners" section of the application settings;
  • Specify "myTarget" in the search bar (see screenshot 6 — step 1), click the "Edit" button next to the name of the module "myTarget (Mail.ru)" (see screenshot 6 — step 2);
Screenshot 6
  • On the "Integration" tab, enable the "In-App Events Postback" transmission (see screenshot 7 — step 1);

  • Select the "Add Manually" option (see screenshot 7 — step 2);

  • In the "SDK event name" drop-down list (see screenshot 7 — step 3), select the desired event names to be passed to in-app event postbacks. Events can be selected from the drop-down list with the names used in the SDK: Appsflyer or myTarget;
Screenshot 7
  • In the "Sending Options" drop-down list (see screenshot 7 — step 4), select "All media sources, including organic" — you need Appsflyer to send in-app event postback from all visible traffic, not just myTarget traffic;
Screenshot 7.1
  • In the "Send Revenue" drop-down list (see screenshot 7 — step 5), select "Values & revenue" — you need myTarget to get the parameter values in the in-app event postback that Appsflyer sends.
Setting a single trg_feed on all postbacks on events

If the transfer of the trg_feed parameter from the mobile application via the SDK is not possible, then you can set a single trg_feed value on the myTarget partner integration settings page in AppsFlyer. In this case, AppsFlyer will transmit a single trg_feed value specified in the settings in myTarget at each postback of the event.

This method is suitable if the advertiser uses only one feed in myTarget, while the mobile application does not use feed identifiers / clients from other advertising systems, on the basis of which one could set up a mapping for feed identifiers on the myTarget side (see the "Matching Identifiers feed based on identifiers from other ad systems").

To set a single feed identifier, specify in the "In-App Events Settings" section for the "trg_feed" field a value in the format <counter ID> _ <feed ID> (for example, 12345_1), then click the Save button (see screenshot 8).
Screenshot 8

Deeplink use — add to feed file

In order for users when clicking on ads of dynamic remarketing campaigns to go directly to mobile applications instead of the advertiser's website, the feed file for each product must specify the deeplink and the application ID in the marketplace (App Store, Google Play). Deep links are used when displaying ads in mobile apps of OK and VK, as well as in apps advertising partners myTarget.

Read more about what kind of deeplinks myTarget supports

Adjust — click attribution

The implementation of deeplinks with attribution parameters in Adjust has several features. When using regular deeplinks (implemented based on the "URL Scheme" technology in iOS or Android Intent URL in Android), it is necessary to correctly set clicks and collect statistics from the Adjust side:
  • Use special GET parameters in deeplink — adjust_campaign, adjust_adgroup and adjust_creative;
Note: For direct deeplinks, the SDK Adjust processes only the specified parameters, and it is with the indication of the "adjust_" prefix, and all other parameters, including standard UTM tags, are ignored (it is possible to include other parameters in the SDK, but they will not be displayed in the Adjust reports, but can only be used as raw data).
Set processing options re-attribution adjust_campaign, adjust_adgroup and adjust_creative in the code of a mobile application (SDK Adjust).
Note: Instructions on how to enable accounting of reattribution parameters in the SDK Adjust are provided in the documentation:

AppsFlyer — click attribution

The implementation of deeplinks with attribution parameters in AppsFlyer has a feature. When using normal deeplinks (implemented on the basis of the "URI Scheme" technology in iOS or the "Intent URL" in Android), in order to correctly assign clicks and collect statistics from AppsFlyer, you need to use special GET parameters in the deeplink — "pid = mail.ru_int" and "is_retargeting = true". The first one determines the source of the transition, the second indicates that the transition was made as part of a retargeting advertising campaign.

Actions with product feed

Add the ios_url, android_url, bundle_id (application ID on Google Play) and ios_app_store_id (application ID on the App Store) to each feed for each product.

Example:
SDK for native apps Android:
<ios_url>app://path/to/scr/?adjust_tracker=abcde</ios_url>
<android_url>app://path/to/scr/?adjust_tracker=fghij</android_url>
<bundle_id>com.app.lite</bundle_id>
<ios_app_store_id>123456789</ios_app_store_id>

Adding dynamic parameters to deeplinks and links

Dynamic parameters (macros) in feed files are not supported, but they can be added at the level of an advertising campaign. For example, you can use the adjust_campaign and adjust_creative parameters, with the values {{campaign_id}} and {{banner_id}}, to segment traffic sources in Adjust by campaigns and ads. These values will be automatically replaced with campaign identifiers and ads, when you click on a banner. Parameters are added both to the link to the site (feed url element) and to deeplinks (ios_url and android_url elements).

To do this, specify the following line in the "Ad layout — add labels manually" section of the campaign settings:
adjust_campaign={{campaign_id}}&adjust_creative={{banner_id}}

Processing postbacks about events in myTarget

Event data is transmitted to myTarget via tracking systems using postbacks. In order for myTarget to start postbacking events from a mobile application, it must be connected to an account. Send a request to connect the application to your manager, or to support (support_target@corp.my.com). In the application, specify a link to the page of your application in the application store (Apple App Store, Google Play), and the account to which the applications should be connected (the account on which dynamic remarketing campaigns will be created for work based on events from mobile applications). In addition, specify whether it is necessary to set rules for matching the names of events and their parameters, as well as the trg_feed parameter on the side of myTarget — information on the comparison with examples of rules and requests is presented below.

Mapping of event names and parameters from the myTarget

If the transfer of names of events and parameters with the names required for dynamic remarketing is not possible, then from the side of myTarget it is possible to set a comparison of names.

In order for us to perform the mapping, let us know the mapping rules — the name of your events and parameters corresponding to those used in myTarget. Rules are set at the application level, so you can set rules for each mobile application individually, but you cannot set different rules for different accounts if the application is connected to more than one account in myTarget.
Example: An application for Android is linked to the account (for example, "com.example.app"), it uses events with the names fb_content_view (product view), fb_addtocart (add to cart), fb_purchase (purchase) and the content_id parameter used in each event to specify the product ID to which the event relates. To match the data, send us a description of the rules of the form "For the com.example.app application, the fb_content_view event corresponds to the viewProduct, the fb_addtocart event corresponds to addToCart, the fb_purchase event corresponds to the purchase, and the content_id parameter corresponds to productid".

Mapping feed ids based on ids from other ad systems

If the transmission of the trg_feed parameter in postbacks by events is not possible, but at the same time some parameter with unique values is already transmitted in each postback (for example, ID of feeds or names of your accounts in another advertising system), then from the side of myTarget it is possible to set the value mapping these parameters with counter and feed identifiers myTarget belonging to the advertiser.

In order for us to perform the matching, let us know the matching rules — the name of your parameter and possible variants of its values, as well as the identifiers of your counters and myTarget feeds corresponding to each of the values. Rules are set at the application level, so you can set rules for each mobile application individually, but you cannot set different rules for different accounts if the application is connected to more than one account in myTarget.
Example: Two Top.Mail.Ru counters are assigned to 00001 and 00002 to the advertiser's account, feed 1 is linked to counter 00001, and feed 2 is linked to counter 00002. In the mobile application, the customer_ID parameter is already used, with the values of shop1 and shop2 (consider them as accounts or feed IDs in another advertising system). To match the data, send us a description of the rules like "Counter 00001 and feed 1 corresponds to the value shop1 from the customer_ID parameter", "Counter 00002 and feed 2 corresponds to the value shop2 from the parameter customer_ID", and so on.
Was this article helpful?
Yes
No