nitin7805
nitin7805

Reputation: 203

Facebook api unable to identify the adset status is approved or disapproved

I am working in app where user can create his advert on Facebook from my app and we charge from user whatever the budget he selected. The flow is our algorithm is something like

  1. Create advert on Facebook with Inactive status.
  2. Charge the selected budget from user.
  3. If successfully charged then Update the Adverts status from "Inactive to Active".

Now the problem is sometimes advert do not approved by Facebook. But till then we have already charged to customer. So here we want to confirm If advert is Approved by Facebook only then charge to customer.

As per the documentation https://developers.facebook.com/docs/marketing-api/reference/ad-campaign/ - effective_status which return the status of adset / advert. But here what I noticed if the Adset is Inactive and delivery status (Ad manager -> delivery) is disapproved then effective status only return "inactive".

Is there any way I can find if advert is approved or disapproved or any other suggestion is appreciated.

Upvotes: 0

Views: 566

Answers (1)

Igy
Igy

Reputation: 43816

As far as I know ads may not be disapproved until after you set them active (i.e after they start spending money) so I'm not sure there's any way to know before charging the customer - you'll probably need to account for this in your business logic

For finding out when an ad is disapproved, I'd recommend using the 'Ad Rules' functionality with webhooks, so your app is notified asynchronously by Facebook when an ad is disapproved so you can take whatever actions are necessary

The documentation contains an example specifically for this use-case, you can set a rule to trigger on disapproval like this:

"trigger" : {
    "type": "METADATA_UPDATE",
    "field": "effective_status",
    "value": ["DISAPPROVED"],
    "operator": "IN"
  },

Upvotes: 1

Related Questions