Tracking link macros

Macros are special labels or markers used in click-, view- and direct URL to get additional information about ad conversions.

For example, in this click-URL template:
https://trk.mail.ru/c/a12345/?idfa={mt_idfa}&clickId={clickId}&sub1={mt_sub1}
macros are the following:

  • {mt_idfa} — device identifier
  • {clickId} — identifier of the attribution click
  • {mt_sub1} — information on ad campaign

How it works

When generating the final click-URL that will be shown to the user, macros must be replaced with specific values. For example, the above template may turn into such a URL:
https://trk.mail.ru/c/a12345/?idfa=AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA&clickId=click123&sub1=offer1
with following replacements:

  • {mt_idfa} → AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA
  • {clickId} → click123
  • {mt_sub1} → offer1

Your partner will replace macros with specific values. Usually, the replacement process is automated. To be able to do this, your partner needs to know what macros are used in URLs.

Some partners may work with default macros provided by MyTracker (see MyTracker macros). For other partners, MyTracker macros in the URL need to be replaced with their own macros (see partner macros).

For more details on click-URL structure and sources of its parameters, refer to Click and Impressions URLs

Partner macros

If a partner uses the own macros in the tracking links, you should configure macros in MyTracker.

For integrated partners (indicated by the symbol ), macros are set by default. If you need to modify it, contact our support team

For non-integrated partner that you have connected yourself, you can set up macros as follows:

  1. Request written documentation or a verbal explanation of their requirements from your partner. Make sure to ask whether they have a preconfigured set of macros for use with tracking links.
  2. In MyTracker interface, find the partner you need in the list and click on its name.
  3. On the page that opens, go to Macros.
  4. Specify the replacements to be made in the tracking links:
    • To add a new line to be filled, click Add macro.
    • In the left column, enter the name of the parameter in the tracking link. The name must match the name of the MyTracker macro or the click-url parameter name you added as a URL parameter in the postback.
    • In the right column, enter the name of the macro, that the partner expects to receive.
    • Make sure to click Save , once all fields have been filled.

For instance, your partner has provided you with the following information:

  • For mt_idfa parameter use %%IDFA%% macro
  • For clickID use %%CLICK_ID%% macro
  • For mt_subId1 use — %%OFFER%% macro

This means that you need to fill the Macros form as follows.

As a result, all tracking links for the partner will include the specified replacements. And the already created links will be updated automatically.

For example, the URL templates on the tracking link view page shown below:
https://trk.mail.ru/c/a12345/?idfa={mt_idfa}&clickId={clickId}&sub1={mt_sub1}
will be modified as follows:
https://trk.mail.ru/c/a12345/?idfa=%%IDFA%%&clickId=%%CLICK_ID%%&sub1=%%OFFER%%

This makes replacing familiar macro markers, such as %%IDFA%% , with specific values an easy job for your partner.

MyTracker macros

List of MyTracker macros that can be used in tracking links:

Device info

Macros Description Example
{mt_idfa} Device IDFA (only iOS) 82706CAC-3B4C-4C76-A9CB-B23F80D87692
{mt_waid} Device WAID (only Windows) 82706CAC-3B4C-4C76-A9CB-B23F80D87692
{mt_gaid} Device advertising id or GAID (only Android) 82706CAC-3B4C-4C76-A9CB-B23F80D87692
{mt_gaid_lc} Lowercased device advertising id or GAID (only Android) 82706cac-3b4c-4c76-a9Cb-b23f80d87692
{mt_idfa_or_gaid} IDFA, or advertising_id (GAID): depends on the platform (Android/iOS) 82706CAC-3B4C-4C76-A9CB-B23F80D87692
{mt_idfa_upper_or_gaid_lower} Uppercased IDFA, or lowercased GAID, depends on the platform (Android/iOS) 82706CAC-3B4C-4C76-A9CB-B23F80D87692
{mt_android_id} Device android_id (only Android) 96c504a0a4f0bb19
{mt_idfv} ios_vendor_id or "app + device" pair (only iOS) 82706CAC-3B4C-4C76-A9CB-B23F80D87692
{mt_oaid} Device OAID (only Huawei Store) 82706CAC-3B4C-4C76-A9CB-B23F80D87692
{mt_app_set_id} Device App set ID (only Android) 82706CAC-3B4C-4C76-A9CB-B23F80D87692
{mt_mna_id} Device mna (only Windows) 82706CAC-3B4C-4C76-A9CB-B23F80D87692
{mt_wna_id} Device wna (only Windows) 82706CAC-3B4C-4C76-A9CB-B23F80D87692

Click/View info

Macros Description Example
{mt_s2s} Sign of tracking link activation from a partner's server, not from the user's device. This link does not lead to the target URL, there is no redirect. Instead, the tracker records a click and return status 204 1 (read-only)
{mt_device_ua} User-Agent. Required when using {mt_s2s} in a click URL. If MyTracker does not receive {mt_device_ua}, the macro will be assigned an empty value Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0
{mt_device_ip} User IP address. Required when using {mt_s2s} in a click URL. If MyTracker does not receive {mt_device_ip}, the macro will be assigned an empty value 172.16.255.2
{mt_ts} Unix timestamp of the click/impression. Required when using {mt_s2s} in a click URL. If MyTracker does not receive {mt_ts}, the macro will be assigned a current server timestamp 1592838075
{mt_no_redirect} Sign of tracking link activation by a partner, without MyTracker redirect. This link does not lead to the target URL. Instead, the tracker records a click and return status 204 1 (read-only)

Traffic info

For information about campaign details, refer to the section SubID

Macros Description Example
{mt_sub1} Additional details Any string
{mt_sub2} Additional details Any string
{mt_sub3} Additional details Any string
{mt_sub4} Additional details Any string
{mt_sub5} Additional details Any string
{mt_network} Additional network breakdowns Any string
{mt_campaign} Additional campaign breakdowns Any string
{mt_adset} Additional ad link breakdowns Any string
{mt_creative} Additional banner breakdowns Any string

Campaign costs info

For information about costs, refer to the section Campaigns > Costs

Macros Description Example
{mt_cost_currency} Currency code: USD, EUR, etc. USD
{mt_cost_value} Cost of target events 1.5
{mt_cost_count} Number of events for which you specified cost (positive integer) 1
{mt_cost_model} Pricing model: CPI, CPM, CPC, etc. CPC