I cannot create an adset. The error message that I get is "You can't run lead ads until your Facebook Page accepts Facebook's Lead Generation Terms of Service." I have already accepted the Facebook's Lead generation's Terms of Service when I create an adset manually.
const params = {
name: 'Test Housing Ad set',
bid_amount: '2',
campaign_id: campaignId,
billing_event: 'IMPRESSIONS',
promoted_object: {
page_id: <PAGE_ID>,
},
targeting: {
[Targeting.Fields.facebook_positions]: ['feed'],
[Targeting.Fields.geo_locations]: { countries: ['US'] },
[Targeting.Fields.publisher_platforms]: ['facebook', 'audience_network'],
},
};
const fields: any[] = [];
try {
const adset = await new AdAccount(accountId).createAdSet(fields, params);
console.log(adset);
} catch (err) {
console.log(err);
}
Any help would be appreciated.