Cost operations

At a glance: Aggregate and view marketing cost data.

5793-images-for-KB-04__1_.jpg

Related articles: Cost aggregation overviewCost ETLAd Spend Ingestion

Cost aggregation

  • Xpend:
    • Acquires advertising cost data by API integration, ad spend ingestion (CSV file upload), and cost by click.
    • Supports various cost models used by the partner, for example, CPI, CPA, CPC, and CPM.
    • Cost data is available in AppsFlyer dashboards and cohort analytics, and by export to an S3 bucket (Cost ETL).
Cost aggregation method Cost models supported Data granularity Data freshness Remarks
API* All

Level depends on the integration

Several times a day, on average every four hours Data may change after the cost event as we try to receive data 7 days back. This enables us to take into account retroactive changes made by the ad network. 
Ad Spend Ingestion (file upload) All Level depends on the file uploaded  Up to 4 hours after ingestion Cost reported can be reverted and corrected data submitted for up to 90 days.
Clicks (attribution link) CPI User-level

Minimum: realtime

Maximum: Up to 4 hours after click

No change possible.
* The API connection to partners is by either Cost API or InCost API (never both). The API used and data granularity provided is partner-dependent.

Cost operations

This section discusses campaign cost operations.

Changing campaign names

AppsFlyer displays campaigns using the campaign ID as the key.

To avoid display anomalies ensure that:

  • Campaigns have a unique campaign ID assigned to them.
  • You don't use the same campaign name with different campaign IDs.

Costs without installs

Why do I see cost data with no installs? This occurs when cost is provided at an upper-level hierarchy (e.g. campaign level), but the performance information (clicks and installs) is provided at a lower level in the advertising hierarchy (e.g. adset).

AppsFlyer completes the cost data for missing dimensions from an upper-level hierarchy. This guarantees a full view of the cost data at any level and minimizes internal discrepancies.

 Example

An advertiser runs a campaign. The advertising hierarchy is as follows:

  • Media source: media_eg
  • Campaign: campaign_eg 
  • Adsetsadest1, adset2

The following information relating to the media source is displayed.

Hierarchy: All Media Sources > media_eg

Campaign Cost Installs
campaign_eg $100 100
campaign_yy $200 1000
campaign_zz $300 2000

Drilling down into campaign_eg, the adset level is shown. 

Hierarchy: All Media Sources > media_eg > campaign_eg 

Adset Cost Installs
None $100  
adset_1 N/A 30
adset_2 N/A 70

In this case, the cost of campaign_eg is $100 and is provided at the campaign level. When drilling down to the adset level, which in this case is the component level, the cost cannot be broken down by adset. 

To overcome this, AppsFlyer carries down the cost from the campaign level and displays it in a separate row. In this case, the adset is shown as none and the installs field left blank

Cost API status

The operational status of cost integration is available as follows:

Integrated partner cost API status

The cost tab in the Integrated Partners section is relevant for ad networks that support getting cost data via API, and displays:

  • The status of your cost integration.
  • Last time AppsFlyer successfully pulled matching cost data.

To view the individual partner cost integration status:

  1. In AppsFlyer, go to Configuration > Integrated Partners.
  2. Select the partner. 
  3. Go to the Cost tab.
    The status and last sync time displays.
Status Remarks/action required
Active Integration is enabled and successfully connected to the ad network.
Partner API is not returning matching cost data

Connection is successful but the API has not returned any cost data matching AppsFlyer campaign attribution data.

This happens because:

  • The campaign ID has not been provided, so the cost can't be matched to campaigns.
  • You integrated a different partner ad account when logging into the partner via AppsFlyer (for example, a different Facebook Ads account). Check you connected the right partner ad account.
  • One of the credential fields in the partner cost integration is incorrect. For example, the bundle ID. Review and correct the integration credentials.
Partner API is not responding
  • The integrated partner's server is not responding to AppsFlyer.
  • Wait 6 hours. If the status message persists, contact AppsFlyer support.
Invalid credentials
  • AppsFlyer can't get data via the API because the credentials are not valid.
  • Reconnect using the correct credentials.
Reach out to your ad network account manager to get access to their reporting API Work with the partner account manager to enable the cost integration in the partner's system.
Partner API is not returning data. Review integration.

This happens because:

  • Your campaigns are paused and there is no data.
  • You integrated a different partner ad account when logging into the partner via AppsFlyer (for example, a different Facebook Ads account). Check you connected the right partner ad account.
  • One of the credential fields in the partner cost integration is incorrect. For example, the bundle ID. Review and correct the integration credentials.
Your account is not enabled on the partner system to get cost

Contact the partner.

Enable Cost API

The API connection to partners is by either Cost API or InCost API (never both). The API used and data granularity provided is partner-dependent. 

Look in the partner list to see if the partner you want to enable cost API for uses Cost API or InCost API.

 Note

If an advertiser uses an agency to run their campaigns, the agency, and not the advertiser, should integrate with the relevant partners. Otherwise, if both the advertiser and agency integrate with a partner using the same credentials for the same app, cost data is duplicated.

Prerequisite:

  • API credentials or login info of the ad network 
  • AppsFlyer matches cost data to attribution data. As such, ensure that attribution links include the campaign ID (and ad set and ad IDs for partners that report with more granularity), without which we are unable to aggregate and report cost.

To enable Cost API:

  1. In the integrated partner Cost tab, enable Get Cost Data.
    The requirements to connect to the partner display.
  2. Enter the required credential fields or login to the ad network (as required).
    If credentials are required, get the credentials from the partner's dashboard or as directed in the AppsFlyer user interface.
  3. If the partner’s cost configuration has Site ID mapping, select the desired site ID configuration from the dropdown. 
  4. Click Save Cost.
  5. Click Test Connection.
    • The message API connection verified displays.
    •  The API is active. AppsFlyer collects data from the partner 6 times a day, on average once every four hours. 
    • Cost data sync status and messages

Site ID mapping

When reporting cost data, some partner integrations allow you to select how the site ID field populates. This means you can configure the site ID so that it matches the AppsFlyer site ID macros as they are in the attribution link.

  • By default, site ID mapping is aligned with the AppsFlyer macros in the attribution link
  • If the attribution link you use has different macros than the site ID mapping options, site ID data will not populate correctly

To select a site ID configuration method:

  1. In the integrated partner Cost tab, go to Site ID mapping, and select a configuration from the dropdown menu.
  2. Click Save Cost.
    The change will take effect from the next day UTC. For example, if site ID mapping occurs on Monday, it will be reflected in data from Tuesday UTC. 

Enabling InCost API

To enable InCost API:

  • In the integrated partner Cost tab, enable Get Cost Data.

Disable Cost API

To disable Cost API: 

  1. Go to Integrated Partners and select the partner.
  2. Go to the Cost tab.
  3. Disable Get Cost Data

Deleting connected accounts in the Cost tab

Connection to some integrated partners is achieved by logging into the partner from within AppsFlyer and connecting to the account. You can delete the connection as needed. Once deleted, AppsFlyer is no longer able to pull cost data from the account. Deleting a connection does not impact historical data. 

To delete a connected account:

  1. In AppsFlyer, go to Configuration > Integrated Partners.
  2. Select the integrated partner, for example, Facebook.
  3. Go to the Cost tab.
    The list of connected accounts displays.
  4. In the actions column, hover over an account.
    The Delete connection option displays.
  5. Click Delete connection.
    A confirmation message displays.

    OauthDelete_en-us.png

  6. Click Delete.
    The account connection is deleted.
    The collection of cost data for the previously connected account stops immediately. There is no impact to historical data. 

Cost currency conversion

If the campaign cost currency provided by the ad network differs from that of the app-defined currency set on the platform, the cost is converted to the app-defined currency as follows:

  • AppsFlyer gets the rates from openexchangerates.org
  • Exchange rates are updated hourly
  • Currency conversions are performed using the last known rate
Was this article helpful?