Reputation: 126
Is it possible to link saved audience to AdSet with FB API?
It is super easy in ads manager, but I can't find how to do it with API.
I looked through marketing api reference (https://developers.facebook.com/docs/marketing-api/reference/ad-campaign#Overview) and AdSet has targeting param, that can be used to specify detailed targeting (custom audiences, interests, age, etc..) but not already premade saved audience...
This is weird because you can find saved audience by id and even get all adsets that are using it, but not vice versa.
Upvotes: 0
Views: 1205
Reputation: 299
While there is no way to use the Saved Audience IDs (like with custom or lookalike audiences) on their own while creating new adsets, you can read the Saved Audience using the Facebook API, and then use the targeting information returned when you create your adset.
Here are the steps:
https://graph.facebook.com/v2.12/6054799058334/?fields=targeting
In the response returned, the "targeting" field will contain the JSON of the targeting information needed for the adset
Now, when you create the new adset, you can set the adset's "targeting" field to the data returned from the API call. Now when you save/POST your new adset, it will contain the targeting from the Saved Audience.
The one downside of this approach is that if you do change your Saved Audience in Ads Manager, your adset will not pick up the changes (as technically they are not linked) - so if your goal is to "link" them up so that any changes will get automatically picked up, the approach above will not work.
Upvotes: 2