Campaign cost

The cost of an ad campaign depends on the platform, ad format, pricing model, and so on. myTracker lets you aggregate all spend information and easily determine 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 URL or Impressions-counter 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. 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 Impressions-counter 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 Constructor. Select from list → Dimension → Traffic source, and also Financial metrics → Campaign cost and ROI.

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