2

I need to query targeting and insights information for all AdSets of a campaign. I have figured out 2 ways of doing it:

  1. Field-expansion: {CAMPAIGN_ID}/AdSets?fields=insights{impressions},targeting
  2. Execute 2 queries (ordinary and leveled): {CAMPAIGN_ID}/AdSets?fields=targeting, {CAMPAIGN_ID}/Insights?fields=impressions&level=ad

There is a similar question here, where the answer states that the first expansion will efficiently execute multiple queries for each adset insight and will cost a lot compared to a level query. So my question: Is that really so and is it better to run 2 queries instead (which logically is more expensive)?

P.S. Is it possible to get the "cost" of the query in the result perhaps? Then I can just test. Created a separate question here for this.

Community
  • 1
  • 1
Ilya Chernomordik
  • 27,817
  • 27
  • 121
  • 207

1 Answers1

1

It is 1 API call, as long as you don´t use batch requests. In that case, each call in the batch counts as one separate call.

andyrandy
  • 72,880
  • 8
  • 113
  • 130