Wrong summary analytics at stats/accounts/:account_id

javascript

#1

Hi all,

I’m using the stats/accounts/:account_id endpoint to create a chart like the one that you can see at ads.twitter.com.
Everything seems fine except for some days that have partial data.

For the dates 1 Apr / 17 Apr 2015 I see that all the days are correct except for the 15 of Apr which doesn’t have all the impresions.

I’m calculating the impressions this way:
{Impressions} : promoted_tweet_search_impressions + promoted_tweet_timeline_impressions + promoted_tweet_profile_impressions

The same day, 15 of Apr, is missing part of the engagements too. It’s like that day is missing part of the data and I don’t know why.

Here is the request that I’m doing:

{ start_time: '2015-04-01T00:00:00-07:00',
  end_time: '2015-04-17T23:59:59-07:00',
  granularity: 'DAY' }

A part from that, I’m trying to find a way to filter BY campaign objetive, and there is no way to filter by that parameter. How do I get that stats for a particular account filtering by campaign objective?

I can see that ads.twitter.com does it this way.

Thanks in advance


#2

You are looking at all campaigns, so as per our Derived Metrics docs campaign metrics depend on their objective. The formula you are using covers most cases, however it’s no good for a campaign with a FOLLOWERS objective. In that case you’d need to add promoted_account_impressions to the mix.

Additionally, ensure that you are using the same start_time and end_time as the Ads UI does if you are trying to replicate the exact same behavior.

With regards to filtering by campaign objective, that’s not something we currently support via the Ads API unfortunately. This is useful feedback - thank you.


#3

Hey Andrs, thanks for your prompt response.

I’ve added the property "promoted_account_impressions to the result but still I see the same result. btw, this property doesn’t have data for that particular date range. "promoted_account_impressions":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]

So I think that another property should be used or maybe the Twitter Ads endpoint is not serving the correct data.

With regards to filtering the results via the Ads API, this is very important for us because if we can’t do it by API then we have to do it in our backend, which implies a lot of work to do.

Regards,
Carlos


#4

That’s odd.

In that case, could you please provide us with a twurl request that showcases these discrepancies?

In terms of filtering results, we appreciate the feedback. we will be sure to make a note of this & bring it up when we are next discussing our roadmap.


#5

Hi @andrs
Request:
$ twurl -H ads-api.twitter.com /0/stats/accounts/okrmq1 -d "start_time=2015-04-01T00:00:00-07:00&end_time=2015-04-17T23:59:59-07:00&granularity=DAY"

And here is the result:

{
  data_type: 'stats',
  data: {
    start_time: '2015-04-01T07:00:00Z',
    promoted_tweet_timeline_card_engagements: [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    promoted_account_follow_rate: [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    promoted_tweet_search_url_clicks: [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    promoted_tweet_search_clicks: [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    promoted_tweet_search_engagement_rate: [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    promoted_tweet_search_favorites: [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    promoted_tweet_search_retweets: [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    conversion_sign_ups: [
      3,
      2,
      0,
      1,
      0,
      2,
      0,
      1,
      0,
      2,
      0,
      0,
      3,
      1,
      1,
      2,
      2
    ],
    promoted_tweet_timeline_favorites: [
      5,
      4,
      3,
      9,
      3,
      3,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      4,
      0,
      1
    ],
    promoted_tweet_app_open_attempts: [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    mobile_conversion_sign_ups_breakdown: {
      total: [
        Object
      ],
      post_view: [
        Object
      ],
      post_engagement: [
        Object
      ],
      assisted: [
        Object
      ]
    },
    promoted_tweet_search_card_engagements: [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    promoted_account_impressions: [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    end_time: '2015-04-18T06:59:59Z',
    promoted_tweet_search_replies: [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    promoted_tweet_search_follows: [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    promoted_account_profile_visits: [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    promoted_tweet_timeline_clicks: [
      79,
      77,
      66,
      111,
      84,
      29,
      1,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      114,
      2,
      32
    ],
    id: 'okrmq1',
    promoted_tweet_timeline_impressions: [
      12446,
      17017,
      10140,
      11916,
      10292,
      4625,
      49,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      19722,
      722,
      5894
    ],
    promoted_account_follows: [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    promoted_tweet_timeline_url_clicks: [
      22,
      18,
      9,
      20,
      19,
      6,
      1,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      31,
      1,
      11
    ],
    promoted_tweet_timeline_engagement_rate: [
      0.006909850554394986,
      0.00511253452429923,
      0.0073964497041420114,
      0.010070493454179255,
      0.008744656043528955,
      0.007783783783783783,
      0.02040816326530612,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0.005831051617483014,
      0.002770083102493075,
      0.005429250084832033
    ],
    billed_follows: [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    granularity: 'DAY',
    mobile_conversion_sign_ups: [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    promoted_tweet_timeline_retweets: [
      5,
      8,
      5,
      6,
      1,
      5,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      1,
      0,
      0
    ],
    promoted_tweet_timeline_replies: [
      0,
      0,
      2,
      2,
      1,
      1,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    promoted_tweet_app_install_attempts: [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    conversion_sale_amount: [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    billed_engagements: [
      14,
      9,
      9,
      9,
      12,
      6,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      19,
      1,
      7
    ],
    conversion_order_quantity: [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    conversion_downloads: [
      6,
      3,
      1,
      1,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      2,
      0,
      0
    ],
    promoted_tweet_timeline_follows: [
      2,
      2,
      2,
      1,
      4,
      1,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    promoted_tweet_search_engagements: [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    promoted_tweet_timeline_engagements: [
      86,
      87,
      75,
      120,
      90,
      36,
      1,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      115,
      2,
      32
    ],
    promoted_tweet_search_impressions: [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ]
  },
  request: {
    params: {
      start_time: '2015-04-01T07:00:00Z',
      end_time: '2015-04-18T06:59:59Z',
      granularity: 'DAY',
      account_id: 'okrmq1'
    }
  }
}

Take a look at promoted_account_impressions it’s filled with zeros.


#6

Thanks @k4rliky - we will investigate this internally as it looks like there might be a bug.


#7

@andrs: I don’t think it’s correct to say to “add promoted_account_impressions to the mix” since the page for Derived Metrics for the Followers objects states that the impressions for such campaigns consists only in promoted_account_impressions, but rather say that the mix should be replaced with promoted_account_impressions. If this is not the case, and impressions for a Followers campaign consists of all 4 metrics added togeher, then the docs are wrong and should be updated.

Also see promoted_account_impressions not valid for a Followers campaign?

Thank you.