Missing properties in the /stats endpoint


#1

Hi all!

I’m trying to calculate the metrics for a particular campaign based on the following article: https://dev.twitter.com/ads/campaigns/metrics-derived

As the Twitter Ads docs says, the CPA for the campaign objective WEBSITE_CLICKS is calculated as follows::

{Conversion} conversion_site_visits
{CPA} billed_charge_local_micro / conversion_site_visits

The problem is that the property conversion_site_visits is undefined in the twitter ads response when doing a request to the endpoint GET stats/accounts/:account_id/campaigns, as you can see here:

 start_time: '2015-02-20T08:00:00Z',
  promoted_tweet_timeline_card_engagements: [ 0, 0, 0, 0, 0, 0, 0 ],
  promoted_account_follow_rate: [ 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_search_url_clicks: [ 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_search_clicks: [ 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_search_engagement_rate: [ 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_search_favorites: [ 0, 0, 0, 0, 0, 0, 0 ],
  billed_charge_local_micro: [ 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_search_retweets: [ 0, 0, 0, 0, 0, 0, 0 ],
  conversion_sign_ups: [ 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_timeline_favorites: [ 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_app_open_attempts: [ 0, 0, 0, 0, 0, 0, 0 ],
  mobile_conversion_sign_ups_breakdown:
   { total: [ 0, 0, 0, 0, 0, 0, 0 ],
     post_view: [ 0, 0, 0, 0, 0, 0, 0 ],
     post_engagement: [ 0, 0, 0, 0, 0, 0, 0 ],
     assisted: [ 0, 0, 0, 0, 0, 0, 0 ] },
  promoted_tweet_search_card_engagements: [ 0, 0, 0, 0, 0, 0, 0 ],
  promoted_account_impressions: [ 0, 0, 0, 0, 0, 0, 0 ],
  end_time: '2015-02-27T08:00:00Z',
  promoted_tweet_search_replies: [ 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_search_follows: [ 0, 0, 0, 0, 0, 0, 0 ],
  promoted_account_profile_visits: [ 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_timeline_clicks: [ 0, 0, 0, 0, 0, 0, 0 ],
  id: '000000',
  promoted_tweet_timeline_impressions: [ 0, 0, 0, 0, 0, 0, 0 ],
  promoted_account_follows: [ 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_timeline_url_clicks: [ 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_timeline_engagement_rate:  [ 0, 0, 0, 0, 0, 0, 0 ],
  billed_follows: [ 0, 0, 0, 0, 0, 0, 0 ],
  granularity: 'DAY',
  mobile_conversion_sign_ups: [ 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_timeline_retweets: [ 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_timeline_replies: [ 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_app_install_attempts: [ 0, 0, 0, 0, 0, 0, 0 ],
  conversion_sale_amount: [ 0, 0, 0, 0, 0, 0, 0 ],
  billed_engagements: [ 0, 0, 0, 0, 0, 0, 0 ],
  conversion_order_quantity: [ 0, 0, 0, 0, 0, 0, 0 ],
  conversion_downloads: [ 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_timeline_follows: [ 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_search_engagements: [ 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_timeline_engagements: [ 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_search_impressions: [ 0, 0, 0, 0, 0, 0, 0 ] }

Others properties exist but conversion_site_visits doesn’t exist.

Is there any way to retrieve those missing properties? Am I doing something wrong?

Thanks in advance


#2

Hey @k4rliky,

Could you provide us with the request you are making using twurl? Are you using the metrics param to specify what metrics you want to get back?

If you look at our Metrics and Segmentation docs you can see that conversion_site_visits is returned by default only when applicable and is only available in the PLATFORMS segmentation. Are you sure conversion_site_visits is applicable you the campaign in question?


#3

Hi @andrs

The following example is a request to the stats endpoint that doesn’t return the conversion_site_visits property.

URL:
https://ads-api.twitter.com/0/stats/accounts/okrmq1/campaigns/244gp
Params: 
{ start_time: '2015-02-20T00:00:00-08:00',
  end_time: '2015-02-27T00:00:00-08:00',
  granularity: 'DAY' }

The objective for this campaign is WEBSITE_CLICKS, your docs says that “any name surrounded by {curley brackets} indicates a derived metric for that category. ( https://dev.twitter.com/ads/campaigns/metrics-derived )”. The {CPA} should be calculated with the formula billed_charge_local_micro / conversion_site_visits, but as conversion_site_visits doesn’t exist, there is no way to calculate the CPA value.

I’ve tried filtering the request with the segmentation_type PLATFORM, the response still doesn’t have that property. I’ve also tried using the metrics param but when I use it I get an empty array without stats (data: []). Why is it recommended to calculate the CPA with that formula if that property doesn’t exist? . None of the tests i’ve done have worked.

We are not using the Twitter Ads API to create campaigns, we are using it to retrieve the information of campaigns that have been already created at twitter.com.

Thanks in advance!


#4

I see - thanks @k4rliky, we’ll look into this and try get to the bottom of it - thanks for your patience.


#5

Hi @andrs

Here is another example of missing properties, a LEAD_GENERATION campaign that doesn’t have the following prop:
promotion_card_responses

As the derived metrics article says, the promotion_card_responses property is used to calculate the {Leads} metrics that is later used to calculate {Lead Rate} and {Cost Per Lead}

{Leads}	promotion_card_responses
{Lead Rate}	promotion_card_responses / {Impressions}
{Cost Per Lead}	billed_charge_local_micro / {Leads}

Here is the response that I get from Twitter Ads API:

{ start_time: '2015-06-17T07:00:00Z',
  promoted_tweet_timeline_card_engagements: [ 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0 ],
  promoted_account_follow_rate: [ 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 ],
  promoted_tweet_search_clicks: [ 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 ],
  promoted_tweet_search_favorites: [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
  billed_charge_local_micro: [ 0, 0, 0, 0, 12920000, 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_search_retweets: [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
  conversion_sign_ups: [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_timeline_favorites: [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_app_open_attempts: [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
  mobile_conversion_sign_ups_breakdown:
   { total: [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
     post_view: [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
     post_engagement: [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
     assisted: [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] },
  promoted_tweet_search_card_engagements: [ 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 ],
  end_time: '2015-06-29T06:59:59Z',
  promoted_tweet_search_replies: [ 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 ],
  promoted_account_profile_visits: [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_timeline_clicks: [ 0, 1, 5, 3, 19, 1, 4, 3, 1, 0, 0, 0 ],
  id: '2mjsz',
  promoted_tweet_timeline_impressions: [ 0, 122, 284, 358, 3315, 284, 244, 293, 265, 0, 0, 0 ],
  promoted_account_follows: [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_timeline_url_clicks: [ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 ],
  promoted_tweet_timeline_engagement_rate:
   [ 0,
     0.0018314176245210726,
     0.00108130081300813,
     0.0010790273556231,
     0.001730038022813688,
     0.0002755102040816326,
     0.000720430107526882,
     0.000479283314669653,
     0.0007397260273972603,
     0,
     0,
     0 ],
  billed_follows: [ 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 ],
  promoted_tweet_timeline_retweets: [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_timeline_replies: [ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_app_install_attempts: [ 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 ],
  billed_engagements: [ 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0 ],
  conversion_order_quantity: [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
  conversion_downloads: [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_timeline_follows: [ 0, 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 ],
  promoted_tweet_timeline_engagements: [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
  promoted_tweet_search_impressions: [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] }

I would like to know any advance on this.

Thank you.


#6

Hi @andrs

Just wanted to know if the Twitter Ads team is working on this.

Thank you


#7

Hi @andrs

Any progress on this?

thanks in advance


#8

@k4rliky have you read through these docs? The first metric you mentioned (conversion_site_visits) is documented there and does indeed exist.

The metric promotion_card_responses was deprecated 2015-07-01 and the Derived Metrics page was updated to reflect that change.