Campaign cost

The cost of an ad campaign depends on the platform, ad format, pricing model, and so on. MyTracker allows you to aggregate all spend information and to determine easily the return on investment for individual partners and advertisements.

Cost tracking

Campaign cost data are always provided by your ad partners. MyTracker supports the following ways to collect this information:

  • with API (by synchronising MyTracker and partner accounts);
  • based on tariffs (you manually add rates in MyTracker);
  • with tracking links (a partner shares data through Click or Impression URL parameters).

The choice of method depends on the capabilities of the advertising partner and its integration with MyTracker.


Some integrated partners share cost per click and impression via the API. To get the data, most often you just need to connect your partner account to MyTracker.

Partners supporting API integration:


MyTracker supports adding tariff plans for any ad campaign: you specify a pricing model, rate, period. The campaign cost will be calculated automatically based on the tariffs for tracked clicks, impressions, and target events.

In addition to tariffs, you can add corrections to any campaign to adjust its cost (for example, due to fines or a bonus program). Learn more in the Tariffs and Corrections sections.

Campaign costs can be sent at the moment of a click or impression. In this case, a partner sends data in an encrypted or unencrypted form in the parameters of the tracking link embedded in the ad.

For unencrypted data transfer, the partner uses the following tracking link macros:

  • mt_cost_currency — currency code: USD, EUR, etc.
  • mt_cost_value — cost of target events, for example, 1.5.
  • mt_cost_count — number of events for which you specified cost (positive integer). For example, 1.
  • mt_cost_model — pricing model: CPI, CPM, CPC

When a user clicks or views the ad, the partner replaces the {macros} with specific values, based on which MyTracker automatically calculates the campaign cost. For example:, that means 1 click costs USD 1.5.

Or, that means 1000 impressions cost USD 1.2. Thus, 1 impression will be equal to USD 1.2 / 1000 impressions = USD 0,0012.

A partner can send parameters via both Click and Impression URLs. Only Click URLs should be used with the CPC (Cost Per Click) and CPI (Cost Per Install) pricing models.

Encrypted data transfer involves the following steps:

  1. A partner requests an encryption key from our support team. Only the partner and MyTracker specialist will know the key.
  2. Using the AES-128-CBC algorithm with ECB, the partner encrypts five parameters: encryption key, currency code, event cost, number of events, and pricing model. Then, the partner encodes the result to Base64 and URL encoded format. For example:
  3. <?php
    $secretKey = hex2bin(trim(readline('Enter secret key: ')));
    $costModel = trim(readline('Enter cost model: '));
    $costValue = trim(readline('Enter cost value: '));
    $costCount = trim(readline('Enter cost count: '));
    $costCurrency = trim(readline('Enter cost currency: '));
    $costQuery = http_build_query([
        'mt_cost_model' => $costModel,
        'mt_cost_value' => $costValue,
        'mt_cost_count' => $costCount,
        'mt_cost_currency' => $costCurrency
    printf("Cost query params: %s \n", $costQuery);
    $costQuery .= str_repeat('0', 16 - strlen($costQuery) % 16);
    $costEncrypt = openssl_encrypt($costQuery, 'aes-128-cbc', substr($secretKey, 0, 16), OPENSSL_ZERO_PADDING, substr($secretKey, 16));
    printf("Cost query encrypted: %s \n", $costEncrypt);
    $linkParam = http_build_query(['mt_enc_data' => $costEncrypt]);
    printf("Link query param: %s \n", $linkParam);
    from Crypto.Cipher import AES
    from binascii import unhexlify
    from urllib.parse import urlencode
    import base64
    secret_key = unhexlify(input('Enter secret key: ').strip())
    cost_model = input('Enter cost model: ').strip()
    cost_value = input('Enter cost value: ').strip()
    cost_count = input('Enter cost count: ').strip()
    cost_currency = input('Enter cost currency: ').strip()
    cost_query = urlencode({
        'mt_cost_model': cost_model,
        'mt_cost_value': cost_value,
        'mt_cost_count': cost_count,
        'mt_cost_currency': cost_currency,
    print("Cost query params: %s" % cost_query)
    cost_query += '0' * (16 - len(cost_query) % 16)
    cipher =[:16], AES.MODE_CBC, secret_key[16:])
    cost_encrypt = cipher.encrypt(cost_query)
    cost_encrypt = base64.b64encode(cost_encrypt).decode('ascii')
    print("Cost query encrypted: %s" % cost_encrypt)
    link_param = urlencode({'mt_enc_data': cost_encrypt })
    print("Cost query encrypted: %s" % link_param)
  4. The partner sends the encrypted data via the tracking link parameter mt_enc_data. For example:{mt_gaid}&mt_enc_data=AaBbCc123
  5. MyTracker decrypts the data and provides the campaign cost and ROI information in reports.

Cost analytics

Control ad spending with MyTracker reports:

  • See the stats on total expenses and profit in the dashboard. Open the Revenue section, and you will see charts detailing the on campaign cost, income and paying audience.
  • Analyse ROI for partners, campaigns and other traffic sources using the Builder. Select from list → Dimension → Traffic source, and also Financial metrics → Campaign cost and ROI.

Make the most out of the Builder features, build reports based on clicks and impressions, LTV, and more. See the Reports section for more details