facebook-marketing-api

Facebook Marketing API: Potential reach of a Facebook campaign

非 Y 不嫁゛ 提交于 2019-12-08 13:13:27
问题 We can run Facebook advert using python SDK. I want to know the potential reach of target audience. Is there any command available or any other way? 回答1: To get the Reach Estimates of a targeting specification using ad account. account = AdAccount('act_<AD_ACCOUNT_ID>') targeting_spec = { 'geo_locations': { 'countries': ['US'], }, 'age_min': 20, 'age_max': 40, } params = { 'currency': 'USD', 'optimize_for': AdSet.OptimizationGoal.offsite_conversions, 'targeting_spec': targeting_spec, } reach

Facebook API marketing: issues with creating custom audience

自作多情 提交于 2019-12-08 06:54:53
问题 I try to add users by APPUID to custom audience. I do post to the url https://graph.facebook.com/v2.10/CUSTOM_AUDIENCE_ID/users with this payload: { "schema": ["APPUID"], "app_ids": ["<APP_ID>"], "data": [["<ID1>"], ["<ID2>"], ...] } Data contains 5000 APPUIDs. The response is: { "invalid_entry_samples": {}, "audience_id": "<AUDIENCE_ID>", "num_invalid_entries": 0, "session_id": "<SESSION_ID>", "num_received": 5000 } But after that the delivery status for this custom audience is: "Audiences

Facebook python marketing API AttributeError

时光总嘲笑我的痴心妄想 提交于 2019-12-08 02:14:43
问题 I am trying to use Facebook Marketing API through its python package facebookapi. here's a code snippet: from facebookads.adobjects.customaudience import CustomAudience audience = CustomAudience(parent_id='act_10336...') audience[CustomAudience.Field.subtype] = CustomAudience.Subtype.custom audience[CustomAudience.Field.name] = 'My new CA' audience[CustomAudience.Field.description] = 'People who bought on my website' audience.remote_create() It is taken directly from Facebook's example for

How can I check Delivery Status of campaign on Facebook Marketing API

馋奶兔 提交于 2019-12-07 04:12:41
问题 I'm doing a little app on Python about this. I was using the "effective_status" field but it shows just if it's paused or not, and I want to check if the campaign is running or not. Thanks. 回答1: Effective_status gives you the effective status of this campaign. For Campaign object, effective_status value can be one of these ACTIVE, PAUSED, DELETED, PENDING_REVIEW, DISAPPROVED, PREAPPROVED, PENDING_BILLING_INFO, CAMPAIGN_PAUSED, ARCHIVED, ADSET_PAUSED If you read the effective_status field for

Possible to specify date_preset with insights edge in Facebook Ads API?

 ̄綄美尐妖づ 提交于 2019-12-07 02:15:34
问题 For the Marketing API, I know that I'm able to make one call to retrieve all of the adsets from a certain account along with their insights, but am I able to specify the date_preset for the insights edge in that same call? For example, the following gives me lifetime insights stats: /v2.4/{accountID}/adcampaigns?fields=insights To be clear - I know this is possible to retrieve by making separate calls for each adset id (where I know I can specify the date_preset); instead, I'd like to do this

Facebook Graph audience insights queries

半世苍凉 提交于 2019-12-06 15:54:56
I found some intriguing Facebook Graph API documentation here: https://developers.facebook.com/docs/graph-api/reference/audience-insights-query https://developers.facebook.com/docs/graph-api/reference/audience-insights-lifestyle/ https://developers.facebook.com/docs/graph-api/reference/audience-insights-lifestyles/ (plural) https://developers.facebook.com/docs/marketing-api/audience-insights-api/v2.8 I think the results of those queries will be really powerful and could help my business. But all of their examples are unclear and nonfunctional, such as: $request = new FacebookRequest( $session,

Facebook Marketing API Get Campaigns per date

橙三吉。 提交于 2019-12-06 12:47:36
I have created an application requesting from facebook's Marketing API, to return all my ad accounts, and from all my ad accounts all my ad campaigns, and from all my campaigns, get insights for a specific date(or date range). Now because my campaigns are too many and I can't make a request for every campaign in a account(even if I wanted the facebook's throttling mechanism kicks in) I am trying to find a way to get only the campaigns that were active or had data on my specific date(date range). I added the 'time_range' parameter as the link below (Api manual) describes: https://developers

Facebook Marketing API get total reach of multiple Ad Sets

倖福魔咒の 提交于 2019-12-06 09:57:47
问题 I am trying to use the Marketing API to get the summary data for multiple Ad Sets. I am able to get the data for each Ad Set with the following: insights/?ids=[**ad_set_ids**]&fields=impressions,clicks,reach,actions,total_actions I can add up the numbers for each Ad Set to get the total and it is fine except for "reach" because the total of reach doesn't just add up to the total (see image below). Is there any way to get the summary of data for the ad sets (the last row in the image "Results

How to get Facebook ad permalink using Facebook APi

本秂侑毒 提交于 2019-12-06 05:14:56
问题 When using ads manager, you can preview ad. There is also a hyperlink which goes View post permalink with comments . Is there any way to get that link using API 回答1: First you must get the creative that's targeted by the ad. $ad = new Ad($ad_id); $ad->read(array( AdFields::CREATIVE, )); Then get the info from the creative. $creative = new AdCreative($ad->creative['id']); $creative->read(array( AdCreativeFields::EFFECTIVE_OBJECT_STORY_ID, )); Then $creative->effective_object_story_id will

Facebook python marketing API AttributeError

别等时光非礼了梦想. 提交于 2019-12-06 04:59:54
I am trying to use Facebook Marketing API through its python package facebookapi. here's a code snippet: from facebookads.adobjects.customaudience import CustomAudience audience = CustomAudience(parent_id='act_10336...') audience[CustomAudience.Field.subtype] = CustomAudience.Subtype.custom audience[CustomAudience.Field.name] = 'My new CA' audience[CustomAudience.Field.description] = 'People who bought on my website' audience.remote_create() It is taken directly from Facebook's example for custom audience creation given here . I put the appropriate AD_ACCOUNT_ID in the second line. I get an