Manage data for multiple ads accounts by Facebook Marketing API - facebook

my team uses many Facebook Business Manager to manage multiple Ad Accounts. Usually our employees will check the Amount Spent and Bill manually in Facebook sites. But now the number of ad accounts increases, I would like to automate the tasks: syncing data from Facebook to our own database (for high manager to view).
I tried with my own Facebook Account (by my own facebook App), I can get the Amount Spent already. My questions are:
What is the API to get Amount Billed, I searched around but not yet found
Because the number of ad accounts is big, what will be the good approach? (I am thinking of create a sole app and let the advertisers authorize it, And use the token to call Graph API; 2nd way is: each facebook user create their own app, this will not need Facebook to approve the app).
Sorry for my bad English, I am really new to Facebook API, please help. Thank you very much.

You can get Budget,Spend... with Ad Set (lifetime_budget,daily_budget)
https://developers.facebook.com/docs/marketing-api/reference/ad-campaign#fields
and get report Cpc,cpm... with Insight
https://developers.facebook.com/docs/marketing-api/reference/ad-campaign-group/insights/#fields

Related

Facebook ad attribution report per-user

My company launched several Facebook ads campaign to drive page likes. Once the campaigns have run for several days, Facebook was able to generate a report of the result of the campaign, showing the number of users that are reached by the campaign aggregated by various dimensions (gender, age, etc).
Given that FB is able to show such aggregate value, I imagine internally FB ads attribution already associated the FB accounts that were reached by said campaign. But no matter what kind of report I try to create, there seems to be no way to download this list of individual accounts that were reached by a campaign, either via API nor GUI.
Is there a way to get this list? Or is it deliberately made not possible due to some regulations or privacy policy?
Facebook deliberately made it this way. You can access the performance data as granular as the ad level, but no further than that. I think attribution solution companies that collaborate with FB have access to the user level information, so the data are definitely collected and stored.

Facebook Marketing API - How to optain Ads Management STANDARD ACCESS?

I have filled the form here. https://www.facebook.com/business/standardadsapi
Also my facebook business manager fulfilling all the facebook terms like having 25+ Ad accounts.
But didn't get any response from facebook. Is there any other way I can try to obtain permission from facebook.
I have gotten Standard Access for multiple apps, usually it takes a few days after you have filled in the application form. So just wait. Check your App's Settings page once in a while, if you get no notification whatsoever after a week or so, shoot FB a message.

Manage facebook ads api

I have a task to integrate facebook marketing api with my web application.
The ultimate aim of my web application is provide a capability for my clients to manage ads without login in facebook. So, I'm asking a question: is it possible to create the only one account for all my clients and manage ads by this account? And if I can, does it right way to use fb marketing api?
Anyway, i would appreciate if someone could give me advice about which approach i should use in my case to manage ads without any client-side authorization.
Yes, you can create ad accounts and run ads on Facebook for any number of clients for nearly any purpose* and not require them to log into Facebook. You can create ad campaigns and creative elements (graphics and links relevant to the client's products) using the Facebook Marketing API in your own ad accounts.
If you haven't seen it already, review the Facebook Marketing API getting started documentation and videos https://developers.facebook.com/docs/marketing-apis
*You're still held to FB terms of service so be sure to review requirements for allowed ad content.

Displaying other peoples facebook timelines on my site

I've got a website I'm doing around a bunch of athletes.
All of these athletes have a Facebook account.
The client wants to show each of these athletes Facebook timelines on their individual profile pages using only their Facebook profile handle that they will provide.
I'm very unfamiliar with the Facebook API but am 99% sure this isn't possible as each of the athletes would have to go to the Facebook developers portal and set up an app right?
Is there any way to achieve this at all?
Nop, you're wrong. Your athletes don't have to setup an app. But, on the other hand, you or the developer responsible for that project, must setup an app at the Facebook developers website.
I'm not going to explain all the process, since the Facebook docs are quite easy to understand.
https://developers.facebook.com/docs/
After you setup your facebook app and integrate it with your website, it's time to start asking the athletes authorization you have plenty of ways to do that, you can either use Facebook Login, Dialogs or evenManually Build a Login Flow.
Keep in mind that you have different permissions, here's a full list of the permissions and a small description explaining what's their purpose.
Each athlete would have to grant permissions to your app, then after they do that, you will get an Access Token and the Facebook User ID, usually the Access Token has a short period of life (aprox. 2 hours), but you can trade this Access Token for a long one with a life time of aprox. 60 days. You can read more about Access Tokens here
After your athletes grant permissions to your app, you can access to their timelines. Keep in mind that it won't be exactly as their timeline on Facebook. To grab user info you can either use Graph API nodes, or if need a more complex and detailed info you can query it using FQL

Integrating Facebook into Google analytics

I want to add the 'Log in with Facebook' option to my website, however I'm unsure how to integrate the information gained when someone logs into my website with Facebook with my current Google Analytics.
Is it possible to link up a visit in Google Analytics with a user who has logged into the site with Facebook to enable me to see things like age, gender etc?
Any help you can give me on this would be much appreciated.
Thanks,
Ben
you may have to do this via a redirection or possibly a frame.
Google Analytics does nolt track individual users, it provides anonymized data. So at the top level, no you cannot do this. However, there are a few more things avaiable to you. One: Facebook provides facebook insights, their own tracking suite, that will give you demographic information on the users of a facebook app or fan page. You site will effectively become a facebook app when you use their user authenication, so you will be able to get insights tracking on you site. At the present moment, facebook insights and google analyitcs do not itegrate or share data. Facebook insight also provides anonymized data, so you will not be able to identify an individual through the tracking.
The final option is, now that you are tracking users through login, you can implement your own tracking info on your site to see what individual users are doing, and attempt to track their preferences.
Its also entirely legal (in the United States at least) to buy access to marketing data and use use your registered user name pool to get additional information.
If you wanted, you could set up a "funnel" in Google.
When a user logs in through Facebook, you could send them to a specific page and then track their progress from there...
http://www.google.com/support/analytics/bin/answer.py?answer=55515
So using this you could get the percentage of users who log in through Facebook... etc.
But to collect information other than that, you would have to get the correct permissions documented here eg. user_birthday (to get the user's Birthday) and query the Graph API from there, thus implementing your own tracking of users.
You can query the Graph API using the various SDKs that Facebook provide explained here.
First of all you should check out this Google document. It explains, how you set a custom unique user id via google analytics.
Further you've to send an event to google analytics (e.g. 'fb_login') via the callback function of your facebook login function.