I’m trying to fetch ads (promoted_tweets)'s stats per day, for an account and date range that show lots of data in the ads manager, however the data coming from the API comes without any number in the stats, all values are None.

This is the account id: 18ce54lpp19
Date range: 2019-03-21 - 2019-04-30

metric_groups = [METRIC_GROUP.ENGAGEMENT, 
                 METRIC_GROUP.MOBILE_CONVERSION, 
                 METRIC_GROUP.WEB_CONVERSION, 
                 METRIC_GROUP.MEDIA, 
                 METRIC_GROUP.VIDEO]

We get all the promoted tweets for the account,
then we iterate over campaigns and get their line_items_ids in order to match exactly which promoted_tweets correspond to each campaign (as we didn’t find any way to ask it directly through the sdk)…
Then we iterate over chunks of 20 promoted_tweet_ids and queue jobs for asking stats like this:

for chunk in chunks_ptw_ids_list:
            queued_job = PromotedTweet.queue_async_stats_job(account=account,
                                       ids=chunk,
                                       metric_groups=metric_groups,
                                       start_time=start_time,
                                       end_time=end_time,
                                       granularity='DAY')

After getting the results, everything has a None on it.

Ie:

('video_views_50', None),
 ('impressions', None),
 ('mobile_conversion_spent_credits',
  {'assisted': None,
   'order_quantity': None,
   'post_engagement': None,
   'post_view': None,
   'sale_amount': None}),
 ('mobile_conversion_installs',
  {'assisted': None,
   'order_quantity': None,
   'post_engagement': None,
   'post_view': None,
   'sale_amount': None}),
 ('mobile_conversion_content_views',
  {'assisted': None,
   'order_quantity': None,
   'post_engagement': None,
   'post_view': None,
   'sale_amount': None}),
 ('mobile_conversion_add_to_wishlists',
  {'assisted': None,
   'order_quantity': None,
   'post_engagement': None,
   'post_view': None,
   'sale_amount': None}),
 ('mobile_conversion_checkouts_initiated',
  {'assisted': None,
   'order_quantity': None,
   'post_engagement': None,
   'post_view': None,
   'sale_amount': None}),
 ('tweets_send', None),
 ('conversion_purchases',
  {'assisted': None,
   'metric': None,
   'order_quantity': None,
   'order_quantity_engagement': None,
   'order_quantity_view': None,
   'post_engagement': None,
   'post_view': None,
   'sale_amount': None,
   'sale_amount_engagement': None,
   'sale_amount_view': None}),
 ('mobile_conversion_reservations',
  {'assisted': None,
   'order_quantity': None,
   'post_engagement': None,
   'post_view': None,
   'sale_amount': None}),
 ('auto_created_conversion_add_to_wish_list', None),
 ('mobile_conversion_tutorials_completed',
  {'assisted': None,
   'order_quantity': None,
   'post_engagement': None,
   'post_view': None,
   'sale_amount': None}),
 ('qualified_impressions', None),
 ('video_views_75', None),
 ('conversion_sign_ups',
  {'assisted': None,
   'metric': None,
   'order_quantity': None,
   'order_quantity_engagement': None,
   'order_quantity_view': None,
   'post_engagement': None,
   'post_view': None,
   'sale_amount': None,
   'sale_amount_engagement': None,
   'sale_amount_view': None}),
 ('media_engagements', None),
 ('auto_created_conversion_sign_up_initiated', None),
 ('follows', None),
 ('auto_created_conversion_download', None),
 ('mobile_conversion_achievements_unlocked',
  {'assisted': None,
   'order_quantity': None,
   'post_engagement': None,
   'post_view': None,
   'sale_amount': None}),
 ('video_3s100pct_views', None),
 ('auto_created_conversion_content_view', None),
 ('app_clicks', None),
 ('mobile_conversion_searches',
  {'assisted': None,
   'order_quantity': None,
   'post_engagement': None,
   'post_view': None,
   'sale_amount': None}),
 ('auto_created_conversion_checkout_initiated', None),
 ('mobile_conversion_site_visits',
  {'order_quantity': None,
   'post_engagement': None,
   'post_view': None,
   'sale_amount': None}),
 ('retweets', None),
 ('mobile_conversion_key_page_views',
  {'post_engagement': None, 'post_view': None}),
 ('auto_created_conversion_added_payment_info', None),
 ('video_cta_clicks', None),
 ('unfollows', None),
 ('likes', None),
 ('mobile_conversion_add_to_carts',
  {'assisted': None,
   'order_quantity': None,
   'post_engagement': None,
   'post_view': None,
   'sale_amount': None}),
 ('mobile_conversion_payment_info_additions',
  {'assisted': None,
   'order_quantity': None,
   'post_engagement': None,
   'post_view': None,
   'sale_amount': None}),
 ('auto_created_conversion_complete_registration', None),
 ('mobile_conversion_re_engages',
  {'assisted': None,
   'order_quantity': None,
   'post_engagement': None,
   'post_view': None,
   'sale_amount': None}),
 ('video_content_starts', None),
 ('video_views_25', None),
 ('mobile_conversion_shares',
  {'assisted': None,
   'order_quantity': None,
   'post_engagement': None,
   'post_view': None,
   'sale_amount': None}),
 ('conversion_site_visits',
  {'metric': None,
   'order_quantity': None,
   'order_quantity_engagement': None,
   'order_quantity_view': None,
   'post_engagement': None,
   'post_view': None,
   'sale_amount': None,
   'sale_amount_engagement': None,
   'sale_amount_view': None}),
 ('engagements', None),
 ('conversion_custom',
  {'metric': None,
   'order_quantity': None,
   'order_quantity_engagement': None,
   'order_quantity_view': None,
   'post_engagement': None,
   'post_view': None,
   'sale_amount': None,
   'sale_amount_engagement': None,
   'sale_amount_view': None}),
 ('auto_created_conversion_add_to_cart', None),
 ('video_views_100', None),
 ('clicks', None),
 ('mobile_conversion_sign_ups',
  {'assisted': None,
   'order_quantity': None,
   'post_engagement': None,
   'post_view': None,
   'sale_amount': None}),
 ('auto_created_conversion_purchase', None),
 ('media_views', None),
 ('card_engagements', None),
 ('video_6s_views', None),
 ('auto_created_conversion_page_view', None),
 ('poll_card_vote', None),
 ('auto_created_conversion_search', None),
 ('replies', None),
 ('url_clicks', None),
 ('video_mrc_views', None),
 ('mobile_conversion_purchases',
  {'assisted': None,
   'order_quantity': None,
   'post_engagement': None,
   'post_view': None,
   'sale_amount': None}),
 ('mobile_conversion_rates',
  {'assisted': None,
   'order_quantity': None,
   'post_engagement': None,
   'post_view': None,
   'sale_amount': None}),
 ('mobile_conversion_logins',
  {'assisted': None,
   'order_quantity': None,
   'post_engagement': None,
   'post_view': None,
   'sale_amount': None}),
 ('mobile_conversion_updates',
  {'assisted': None,
   'order_quantity': None,
   'post_engagement': None,
   'post_view': None,
   'sale_amount': None}),
 ('conversion_downloads',
  {'metric': None,
   'order_quantity': None,

A Specific case to check:
Line item id: ethft
Promoted tweet id: 2yzy78
3/21/2019 to 4/30/2019

I’d appreciate any help with this.
Thanks in advance

@Outflink I can’t reproduce it. Also, MOBILE_CONVERSION data should be requested separately (I see you’re requesting it along with other metric_groups).

When you say you can’t reproduce it it means that you see data instead of None?
@jrsyo wow, I’ve just took out MOBILE_CONVERSION from it and I see numbers now. Didn’t check them but I see data.
So maybe that was the issue, but how come it didn’t gave me an error?
Can I ask mobile instead of web, just in the same query as I did before?

@Outflink Yes, I see data at least for ALL_ON_TWITTER placement when I request it separately.

@Outflink See our documentation:
https://developer.twitter.com/en/docs/ads/analytics/api-reference/asynchronous#post-stats-jobs-accounts-account-id

Note : MOBILE_CONVERSION data should be requested separately.

I understand we could return an error if that’s the case and it must be. I’ll take this as feedback to the team.

@jrsyo Thanks for your answer!
Just another question.
There is any way to ask for stats and have the campaign name, and adgroup id and name (or other qualitative data) included in the answer? Or should I ask the data in different queries, iterate and match them afterwards?

What’s the best practise here?
Thanks!

@Outflink No, there isn’t a way to do so.

Or should I ask the data in different queries, iterate and match them afterwards?

so it’s yes. Unless you sync entity’s (e.g., campaign, line_item etc) metadata somewhere in you system, you need to query it separately using the Ads API.

As a side topic, we recommend utilizing the Active Entities endpoint to reduce the number of analytics call and improve your pipeline further.

@jrsyo Thank you very much!