facebook graph api Ad Insights do not return adset_name field

650 Views Asked by At

I'm using python for interacting with Facebook Graph API Ad Insights and I'm using a "system user" token to authenticate. I have no problem with any other field but I cannot get data for the adset_name field.

  • I have "ads_read" permission on my token.
  • I'm using facebook-business 12.0.1 package.
  • I'm calling facebook_business.adobjects.adaccount.AdAccount.get_insights_async

And the request params are as below:

fields: ['campaign_name', 'adset_name', 'impressions', 'unique_inline_link_clicks',
 'spend', 'actions', 'conversions', 'conversion_values', 'action_values'] 
params: {'time_range': {'since': '2021-11-16', 'until': '2021-11-18'}, 
'level': 'campaign', 
'export_format': 'csv', 
'time_increment': 1, 
'action_attribution_windows': '1d_click'}

I'm not posting a response but I can assure you that there is no sign of "adset_name" anywhere. And all the other fields listed here are returning successfully

is this about a lack of permission on my token ?

1

There are 1 best solutions below

0
kommradHomer On

I just figured out that I cannot receive anything about adset_name or adset_id because of choosing AdsInsights.Level.ad as level. All resolved when I used AdsInsights.Level.ad