1

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.

1 Answers1

0

You have to be an Ad Account Admin or Ad Account Advertiser and manually accept them from https://www.facebook.com/ads/leadgen/tos

UPDATE: I solved the problem. In my case, the token I was using to make the API call was generated for a user different from the one who accepted the TOS. I generated a new token with the user who had accepted the TOS and it worked again.

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 30 '22 at 07:16