facebook-marketing-api

Match facebook campaign objective with insights actions types

倾然丶 夕夏残阳落幕 提交于 2019-12-03 03:06:07
Facebook campaigns have an objective among those listed here ( PAGE_LIKES , VIDEO_VIEWS , etc). Facebook insights list users actions among those listed here ( like , video_view , etc, but some are missing, unlike for example). The problem is: objective and actions do not match. For example, there is a PAGE_LIKES objective and a like action. In the facebook power manager there is a "Results" column which gives, for each campaign, the user actions count that match the campaign objective ( 992 like obtained in the picture below ). It seems that there is no such things in the insights ( neither in

Facebook Ads API to update “Customer List: Value-based”

ε祈祈猫儿з 提交于 2019-12-02 23:23:53
问题 I created a Custom Audience of type "Customer List: Value-based". I then used that to create a "value-based Lookalike Audience". The documentation for "value-based Lookalike Audience" is here. But what I want to know is: How can I use the PHP SDK to update my Custom Audience of type "Customer List: Value-based" via the API? (Then, the changes will flow through to the lookalike audience, which is what I use in my ads targeting.) I cannot find documentation. P.S. Ding Zhang of Facebook

Not getting paused ads insights using Facebook Marketing API

女生的网名这么多〃 提交于 2019-12-02 13:51:39
问题 I wrote this script that returns a list of ads with their stats but apprently I'm getting only insights for active ads and not paused ones - For paused ones, I'm just getting the campaign name and its id ! I tried using filtering like below but it's not working: '' first = "https://graph.facebook.com/v3.2/act_105433210/campaigns?filtering=[{'field':'effective_status','operator':'IN','value':['PAUSED']}]&fields=created_time,name,effective_status,insights{spend,impressions,clicks}&access_token=

Facebook Ads API to update “Customer List: Value-based”

戏子无情 提交于 2019-12-02 10:37:04
I created a Custom Audience of type "Customer List: Value-based". I then used that to create a "value-based Lookalike Audience". The documentation for "value-based Lookalike Audience" is here . But what I want to know is: How can I use the PHP SDK to update my Custom Audience of type "Customer List: Value-based" via the API? (Then, the changes will flow through to the lookalike audience, which is what I use in my ads targeting.) I cannot find documentation. P.S. Ding Zhang of Facebook encouraged me to ask the question here since none of the people I reached at FB were willing to answer my

making complex queries using python and facebook marketing api (targeting)

情到浓时终转凉″ 提交于 2019-12-02 09:49:07
i am trying to make complex queries in order to know things like "the is the size of population (audience size) of people who are interested in football and also live in new york". i have access token, and yet i can't make complex conditions, only 1 condition at a time. another problem is that i take the curl code and i conver it to python code using https://curl.trillworks.com/ so far i did this code: import requests data2 = [('type', 'adinterest'),('q','football'), ('access_token','my_access_token'),('limit','1000')] response = requests.get('https://graph.facebook.com/v2.11/search',params

Not getting paused ads insights using Facebook Marketing API

匆匆过客 提交于 2019-12-02 06:40:46
I wrote this script that returns a list of ads with their stats but apprently I'm getting only insights for active ads and not paused ones - For paused ones, I'm just getting the campaign name and its id ! I tried using filtering like below but it's not working: '' first = "https://graph.facebook.com/v3.2/act_105433210/campaigns?filtering=[{'field':'effective_status','operator':'IN','value':['PAUSED']}]&fields=created_time,name,effective_status,insights{spend,impressions,clicks}&access_token=%s"% token Then I check using: result = requests.get(first) content_dict = json.loads(result.content)

How to add user to facebook custom audience

丶灬走出姿态 提交于 2019-12-02 03:30:44
问题 I am trying to add user to custom audience using following code $audience = new CustomAudience($custom_audience_id); $audience->addUsers(array(trim($mailAddress)), CustomAudienceTypes::EMAIL); and $users = array( array('fname', 'lname', 'someone@example.com'), array('fnamenew', 'lnamenew', 'someone_new@example.com'), ); $schema = array( CustomAudienceMultikeySchemaFields::FIRST_NAME, CustomAudienceMultikeySchemaFields::LAST_NAME, CustomAudienceMultikeySchemaFields::EMAIL, ); $audience = new

How to add user to facebook custom audience

拜拜、爱过 提交于 2019-12-02 00:59:56
I am trying to add user to custom audience using following code $audience = new CustomAudience($custom_audience_id); $audience->addUsers(array(trim($mailAddress)), CustomAudienceTypes::EMAIL); and $users = array( array('fname', 'lname', 'someone@example.com'), array('fnamenew', 'lnamenew', 'someone_new@example.com'), ); $schema = array( CustomAudienceMultikeySchemaFields::FIRST_NAME, CustomAudienceMultikeySchemaFields::LAST_NAME, CustomAudienceMultikeySchemaFields::EMAIL, ); $audience = new CustomAudienceMultiKey(<CUSTOM_AUDIENCE_ID>); $audience->addUsers($users, $schema); But I am getting

How to aduser with admin access while creating ad account facebook marketing api

可紊 提交于 2019-12-01 22:39:29
I am trying to create ad account in Facebook business manager via Facebook marketing and graph API using following code. $attachment = array('access_token' => $this->accessToken, 'name' => $associative_arr['name'], 'currency' => $associative_arr['currency'], 'timezone_id' => $associative_arr['timezone_id'], 'end_advertiser' => $this->mybusinessId, 'media_agency' => 'NONE', 'partner' => 'NONE', 'access_type' => 'OWNER', 'permitted_roles' => 'ADMIN' //'user_role' => '1001' ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,'https://graph.facebook.com/'.$this->apiVersion.'/'.$this->mybusinessId.'

Facebook Marketing API - Python to get Insights - User Request Limit Reached

ぐ巨炮叔叔 提交于 2019-11-28 11:38:17
So I am trying my best to navigate my way through the Facebook API. I need to crate a script that will download my business' campaign information daily as a csv file so I can use another script to upload the information to our database easily. I finally have code that works to print the information to the log, but I am reaching the user request limit because I have to call get_insights() for every single campaign individually. I am wondering if anyone knows how to help me make it so I don't have to call the facebook API as often. What I would like to do if find a field where I can get the