Discrepance Between Ad Manager and Twitter Ads API

ads
api
adsap
twitterads

#1

My Problem

So the main problem is: i’m getting discrepancies in the api and on the twitter ads manager on two campaigns: ‘9vfi2,9vg46’

the other campaigns are giving me the right results. Just on both i can’t get the billing, impressions and clicks right. Hope i can have an answer for my problem.

The other campaign ids are: 9o3qr,9o43f,9pdao,9pddj,9s6s0,9tb5w,9tcij,9tcqg,9tcue,9tcwx and they´re giving me the right results.

I just need to extract: campaign_id,spend*, impressions and clicks.

*i think the spend should be equal to billing_charge_local_micro

This is my API call

import requests

content = requests.get('https://ads-api.twitter.com/2/stats/accounts/18ce54kpnge/', auth=twitterinit(),
                           params={
                               'start_time': datestart+'T00:00:00-0300',
                               'end_time': str(lastdate)+'T00:00:00-0300',
                               'entity': 'CAMPAIGN',
                               'granularity': 'TOTAL',
                               'metric_groups': 'ENGAGEMENT,BILLING',
                               'placement': 'ALL_ON_TWITTER',
                               'entity_ids': campaignslist
                           }).json()

The json response for both campaigns with this call on start_date and end_date set to 2017-11-23

    {
        id": "9vfi2",
        "id_data": [
            {
                "metrics": {
                    "app_clicks": [
                        273
                    ],
                    "billed_charge_local_micro": [
                        471564778
                    ],
                    "billed_engagements": [
                        89
                    ],
                    "card_engagements": [
                        273
                    ],
                    "carousel_swipes": null,
                    "clicks": [
                        470
                    ],
                    "engagements": [
                        769
                    ],
                    "follows": [
                        4
                    ],
                    "impressions": [
                        73196
                    ],
                    "likes": [
                        48
                    ],
                    "poll_card_vote": null,
                    "qualified_impressions": null,
                    "replies": [
                        4
                    ],
                    "retweets": [
                        5
                    ],
                    "tweets_send": [
                        2
                    ],
                    "url_clicks": null
                },
                "segment": null
            }
        ]
    },
    {
        "id": "9vg46", 
        "id_data": [
            {
                "metrics": {
                    "app_clicks": [
                        158
                    ], 
                    "billed_charge_local_micro": [
                        285472181
                    ], 
                    "billed_engagements": [
                        60
                    ], 
                    "card_engagements": [
                        158
                    ], 
                    "carousel_swipes": null, 
                    "clicks": [
                        373
                    ], 
                    "engagements": [
                        554
                    ], 
                    "follows": [
                        3
                    ], 
                    "impressions": [
                        52207
                    ], 
                    "likes": [
                        32
                    ], 
                    "poll_card_vote": null, 
                    "qualified_impressions": null, 
                    "replies": [
                        9
                    ], 
                    "retweets": [
                        5
                    ], 
                    "tweets_send": [
                        1
                    ], 
                    "url_clicks": null
                }, 
                "segment": null
            }
        ]
    }, 

Here’s the discrepance:


The campaigns with the problem are: TT-RG-All-iOS-AppInstall,TT-RG-All-Android-AppInstall, the others are fine.


#2

I solved

The problem was on the placement parameter, for both campaigns i should’ve also got data from PUBLISHER_NETWORK also.

Since i’m here, is there a tag so i can get from both?
Something like ‘placement’:‘ALL_ON_TWITTER,PUBLISHER_NETWORK’

Anyway, this topic can be closed now.

Sorry.


#3

@nicolasmelo: To determine whether you need to request data for both ALL_ON_TWITTER and PUBLISHER_NETWORK, look at the placements property on the line item. For example:

$ twurl -H ads-api.twitter.com "/2/accounts/18ce54d4x5t/line_items/93evz"
{
  "request": {
    "params": {
      "line_item_id": "93evz",
      "account_id": "18ce54d4x5t"
    }
  },
  "data": {
    "bid_type": "TARGET",
    "advertiser_user_id": 756201191646691328,
    "name": "Untitled",
    "placements": [
      "TAP_FULL_LANDSCAPE",
      "TAP_NATIVE",
      "TWITTER_TIMELINE",
      "TWITTER_PROFILE",
      "TAP_FULL"
    ],
    "start_time": null,
    "bid_amount_local_micro": 500000,
    "automatically_select_bid": false,
    "advertiser_domain": "twitter.com",
    "target_cpa_local_micro": null,
    "primary_web_event_tag": null,
    "charge_by": "APP_CLICK",
    "product_type": "PROMOTED_TWEETS",
    "end_time": null,
    "bid_unit": "APP_CLICK",
    "total_budget_amount_local_micro": null,
    "objective": "APP_INSTALLS",
    "id": "93evz",
    "entity_status": "ACTIVE",
    "account_id": "18ce54d4x5t",
    "optimization": "DEFAULT",
    "categories": [
      "IAB12"
    ],
    "currency": "USD",
    "created_at": "2017-06-15T15:05:37Z",
    "tracking_tags": [],
    "updated_at": "2017-06-15T15:05:37Z",
    "include_sentiment": "POSITIVE_ONLY",
    "campaign_id": "8qo09",
    "creative_source": "MANUAL",
    "deleted": false
  }
}

In addition to seeing PUBLISHER_NETWORK, having any TAP_* enums in placements means the ad(s) associated with this line item may be displayed in the Twitter Audience Platform and that you should request PUBLISHER_NETWORK stats. See more information in this announcement. Note that this logic should be used for any enum that begins with “TAP_”.

In terms of making a single request to our analytics endpoints to retrieve stats for both placements, that’s not possible.

Hope this helps clarify things.