Facebook marketing API Does not select the correct pixel conversion event - facebook

I'v built an app that creates ads using the marketing API. When it creates the adset it sets a specific pixel and a page view event.
All our users get the correct pixel and the correct event except for one user.
Here is the object from the post request that is being sent to Facebook where we can see that they are equal
User one
"promoted_object":"{\"pixel_id\":xxxxxxxxxx63,\"custom_event_type\":\"CONTENT_VIEW\",\"pixel_rule\":\"{\\\"event\\\":{\\\"eq\\\":\\\"PageView\\\"}}\"
User two
"promoted_object":"{\"pixel_id\":xxxxxxxxxx63,\"custom_event_type\":\"CONTENT_VIEW\",\"pixel_rule\":\"{\\\"event\\\":{\\\"eq\\\":\\\"PageView\\\"}}\"
Both get the correct pixel with the correct id but one gets no conversion event, and say Missing conversion event.
Both ad accounts have full access to the pixel under the business settings in ads manager.
Here is an image that describes the issue.
Anyone have any ideas here?

make sure the conversion event is defined in that account.
The conversion event is usually set on Campaign Level and supplied when you create a campaign via API.
As you're trying to use a custom conversion it might be that you've created it for one account but didn't create it for another. That's why you don't see it in you campaign setup view. You can create it via API as described here:
Custom Conversion API
Or just do it via Business Manager and use it afterward when creating you campaigns via API or manually.
It's definitely not a request that fails in this case but a proper account configuration.

Related

Get results for specific facebook marketing campaigns objectives

Each Facebook ad campaign has an objective, such as LINK_CLICKS or CONVERSIONS.
In Ad Manager, one can see the performance of each of their ad campaigns. There is a column called "results" that has the number of objective-specific conversions for that campaign. So for example, if the objective is PAGE_LIKES then results would show the number of page likes resulting from the campaign, but if the objective was LINK_CLICKS then results would show website clicks.
My question is: Is there something in the Insights API that equates to the results column in Ad Manager? Part of the reason I ask is for ease and consistency, but also some of the objectives are ambiguous, e.g. BRAND_AWARENESS.
No, I haven't been able to easily replicate the results and cost per result columns from the ad manager with an API call.
First you can check the URL when in the ad manager to see which columns are selected by looking at the GET parameter columns:
https://business.facebook.com/ads/manage/powereditor/manage/ads?act=...&business_id=..&columns=name%2Cerrors%2Cdelivery%2Cresults%2Creach%2Cimpressions%2Ccost_per_result&...
Decoding this gives the following fields:
columns=name,errors,delivery,results,reach,impressions,cost_per_result
Now it looks like we could simply use the result and cost_per_result fields, but that gives an error:
(#100) results, cost_per_result are not valid for fields param.
This is expected as the API document doesn't specify results and cost_per_result as valid fields.
Now when in the ad manager we can also see the API calls use the network tab of developer tools to see it making API calls to retrieve data. This shows us the result and cost_per_result fields being used. You can actually copy the request URl and see it working... somehow..
Trying to recreate this API call in the Graph API Explorer only worked for me when I copied the access token from the previous call. This makes me feel that the business manager has a special access token.

Cannot retrieve the reach estimate for some Facebook ads (from the API)

The API lacks some clear explanations on retrieving the reachestimate for either an ad account or an ad. I have made sure that:
I am an admin/ or added to a Facebook app
I have a paid advertising campaign
The adaccount ID is added in the Settings Advanced panel of the Developer App page
I've been trying to:
In Graph API Explorer, retrieve the data by query expansion: me?fields=adaccounts{campaigns{adsets{ads{reachestimate}}}}. However, I always get one of the following (randomly):
Still in the explorer, retrieve it by direct access: act_{adaccount_id}/reachestimate I get this, even if I am 100% sure the ad account is added in the Advanced Settings panel:
Both of 1 and 2 in the iOS project. I get this: com.facebook.sdk.core error 8
Test it by curl with the example from here. I get this (the same with the one from point 2): The ad account is not enabled for usage in Ads API.
Just as a further note, for point 1 that's not the whole query, but I didn't write the adjacent fields because they would've been redundant for the purpose of this question.
I simply need to retrieve the ad accounts, the campaigns, the ad sets and the reach estimate simultaneously in the same query. It seems like a dead spot for me. Do you have any suggestions? Can you show me a Graph API explorer working example? Or, if what I'm asking is impossible, can you simply show some code that works?
Are you app and ad account owned by the same person?
Facebook Ads API has tiered access. https://developers.facebook.com/docs/marketing-api/access
A newly registered app is in Development Tier and can only access the user's own ad accounts. You need to make some API calls on your own ad account for testing in order to get promoted to Basic Tier and manage other people's ad account.
Apparently, I got:
Please reduce the amount of data you're asking for, then retry your request.
Because the query was to broad. Those 'adjacent' fields actually triggered a massive query, so the solution was to either:
Put a limit(1) on the campaigns.
Individually retrieve the reachestimate for each adset.
I chose the latter because it suited my needs, but it's up to you which solution works better.

How to get information on box account creation using okta api?

okta when configured, automatically creates box accounts for new users added to okta's AD.
Is there any way to get information from box if the account created by okta is successful or not? I am referring only API calls.
If I understand correctly, the way Okta is configured on your side is that when new users are created in Okta, they are assigned to and created in Box as well (probably using group assignment to Box?)
If that is the case and you want to make sure that users are created in a downstream app Box, you can use Okta's event API to confirm.
Please see this link: http://developer.okta.com/docs/api/resources/events.html#application-user-management
The event type (action.objectType) you are looking for is: app.user_management.push_new_user
You can make following call to get the user created in Box:
GET /api/v1/events?filter=published gt "2016-11-17T00:00:00.000Z" and action.objectType eq "app.user_management.push_new_user" and targets[1].displayName eq "<Box_App_Name>"
Where <Box_App_Name> is the displayName of the app under targets as it appears. Before you run the call above, you may need to confirm the displayName of Box or alternatively, use the id (better than displayName) from targets array.

How to retrieve multiple user account details through their Facebook IDs in graph API?

This could be a duplicate of here and here, but can some one provide a complete working example for following.
I have set of different Facebook account Ids, and i need to get the respective account details(user name etc) from these account ids. I need to send a Batch Request for Graph API. Something as follows,
(https://graph.facebook.com?ids=user1, user2, user3,...)
Is this possible as pure HTTP GET request ?
I am using Facebook SDK with Android for the moment. I have gone through the API doc but unable to build the required query yet. Please help.
Maybe post a snippet of your code so we can try to solve your problem better. With the info you provided, the URL https://graph.facebook.com/?ids=user1,user2,user3 works just fine and returns 3 users.
The URL format looks correct. Keep in mind the total character limit, but otherwise I suspect you are stuck in a different place (e.g. sending the query or saving the result).

Facebook conversion pixel with "server to server" option

I'm investigating usage of CPA ad types in our application and was reading about pixels for tracking conversions. It states that there are JS/HTML pixels available, but I'm wondering if there is a pixel that could be triggered on server side, (i.e. using file_open from our script). This would be a huge benefit for my app, since it would enable me to lower discrepancy and also allow more flexibility.
Does anyone have an idea?
No, there is no ability to record conversion using a server-to-server method at the moment.
Now you have options for behavior like this. Note: You cannot fire a "piexl" from the server, because pixels are specific to web pages.
Facebook created the Offline Conversions api to allow you to upload conversions that happen outside a website, like users purchasing something in a brick and mortar, or conversions that don't count until you have verified the information yourself (i.e. you must have a human review a user's sign up)
Now the right way to do it is using the Conversions API:
The Conversions API allows advertisers to send web events from their servers directly to Facebook. Server events are linked to a pixel and are processed like browser pixel events.
So it's exactly what you need.
(It's previously called Facebook Server-Side API, by the way.)