Questions tagged [facebook-ads-api]

The Facebook Ads API (aka Marketing API) is used by application developers to create, manage and measure ad campaigns that run on Facebook.

The Facebook Marketing API (previously referred to as Ads API) is an interface into Facebook to create ads, manage campaigns, and measure the performance of a campaign. The Facebook Marketing API has various levels of access, some of which may require an application and review process. See Facebook's Marketing APIs access documentation for more details.

The Facebook Marketing API is a subset of the Facebook Graph API where requests and responses are sent over HTTP and the responses are usually returned as JSON.

The Facebook hosted documentation is available here: Facebook Marketing API Documentation

867 questions
3
votes
2 answers

How to get ad_id in Facebook Ads?

I want to moderate Instagram ads, but I can not access the ad_id. I have done the "http delete request" to enter the ad_id value but I get an error. How can i get the ad_id in facebook ads api? DELETE REQUEST…
3
votes
0 answers

creating facebook short lived token from long lived token

Our app does not have a Facebook login. We have our own login that does not tie to Facebook login any way. Our server uses a never expire token to make api calls (server to server) as majority of the calls will need to update/manipulate things in…
Bhavin
  • 427
  • 3
  • 15
3
votes
2 answers

how to access protected property response from facebook in facebook ads api

I am getting a protected object returned from the API call to Facebook Ads. $page = new Page($page_id); $leadgen_forms = $page->getLeadgenForms(); I am getting the response like this : FacebookAds\Object\Page ( …
3
votes
2 answers

Get all active campaigns from facebook ads api - how to set the filter

I would like to get insights of all my active campaigns running on Facebook Ads. I manage to get all campaigns with FacebookAdsApi on my account but i am not able to use a filter so i only get campaigns with the "ACTIVE" status. Here is my code so…
RandomDude
  • 1,101
  • 18
  • 33
3
votes
1 answer

Mobile Web Audience Network with Cordova/Ionic

I implemented Facebook's new mobile web native ads in an ionic app, and everything works perfectly locally. However when I run the app on an IOS device, the ads won't load. Anyone knows why? I'm suspecting it has to do with the fact that the app…
3
votes
1 answer

Facebook Ads API - Can't Edit Audience

I'm trying to create custom audience & followed the instructions given here. This is the code I've used. $audience = new CustomAudience(null, 'act_'.$account_id); $aud_data = array( CustomAudienceFields::NAME => $name, …
Vishwa
  • 1,525
  • 2
  • 13
  • 25
3
votes
1 answer

How to get FB AD account name via Python API?

Am trying to get a list of ad accounts in my business manager in the form of: This is how a get the list of ad accounts: FacebookAdsApi.init(my_app_id, my_app_secret, my_access_token) me =…
3
votes
1 answer

Facebook Marketing API: retrieving metadata for many Ads via Python

I hope, someone has stumbled over the same issue and might guide me towards a simple solution for my problem. I want to retrieve regularly some data regarding my Ads on Facebook. Basically, I just want to store some metadata in one of my databases…
3
votes
1 answer

How to call Facebook Pixel Event from AngularJS controller?

I want to track conversion of a Facebook Ad. Therefore I need to call fbq('track', 'CustomerRegistration'); in the signup result page but I don't have one. User is redirected to the dashboard after successful signup. So I need to call fbq from the…
Burak
  • 5,706
  • 20
  • 70
  • 110
3
votes
2 answers

Facebook Ad insight GRAPH API edge for a date range

I am trying to get Facebook Ad stats for a given date range using Facebook Graph API. It doesn't seem to work. https://graph.facebook.com/v2.5/6039003162091/insights?since=2016-03-14&until=2016-03-15&access_token=<> Any idea how I should go about…
CKSharma
  • 31
  • 2
3
votes
2 answers

read entire fb ad account structure

v2.5 (Using java to implement http/json rest layer) What is the most efficient way to read the entire structure of an FB ad account, by which I mean, all the entailed campaigns, adsets, ads and ad creatives? Here is one way, which as a relative…
3
votes
3 answers

FB Ads API (#17) User request limit reached

I am working on Facebook ads api to get the account Campaign data.What I am doing here is I get list of all campaigns and doing forloop of each campaign get Campaign stat $campaignSets = $account->getCampaigns(array( CampaignFields::ID, …
Ronak Shah
  • 450
  • 2
  • 9
  • 23
3
votes
2 answers

Facebook Ads API : Error 272 This Ads API call requires the user to be admin

I am using Facebook Ad Api to create ads. How ever when i grant a user Administrator Role (1001) with the following api call: https://graph.facebook.com/v2.5//users?role=1001&uid=xxxxx it successfully creates the user, and when i get…
3
votes
1 answer

'Invalid OAuth access token' while getting adAccount detail.

I am using FB Ads API, following steps described in documentation and created my PHP file as bellow. It gives me Fatal error: Uncaught exception 'FacebookAds\Http\Exception\AuthorizationException' with message 'Invalid OAuth access token.' in…
3
votes
0 answers

Is it possible to get cost data on a destination URL level through Insights?

I'm using the Facebook Marketing API (Insights to be specific) and I want to get the spend per destination URL per day. As documented, it seems to only be possible on the following levels: Account Campaign Group Campaign Ad Group Currently I'm…
mtricht
  • 427
  • 4
  • 16