Getting campaign ID with timestamp on app install - facebook

I'm running a Facebook App Install campaign, but can't install Facebook Analytics SDK due to business constraints. The app event API (https://developers.facebook.com/docs/marketing-api/app-event-api) allows me to post an install event, but only gives true/false as response.
{
"success": true
}
Is there a way to get campaign ID & timestamp of ad click as well?

You can't get the campaign ID from the API response. However, you can use Facebook Analytics without using the Facebook SDK. You can log events by manually calling the API (which it looks like you're already doing), or through a Mobile Measurement Partner (MMP). As long as the logged event is associated with an advertiser ID or mobile cookie, the Facebook servers will attempt to match it to a user. If the matched user saw an ad in your campaign, then the install event will be associated with a campaign ID.
You can use Facebook Analytics to view information about users that installed your app from your campaign. See this article. That article focuses on using install sources in filters, but they can also be used in other analytics tools, such as breakdown tables.

Related

Facebook Graph Api Get Event By Id

I am trying to receive an event from the Facebook Graph Api By Id with following request:
https://graph.facebook.com/{eventid}?access_token={app_accesstoken}
I am using an app-accesstoken. The Event is a public event and according to the Graph Api docs I should be able to receive public events with any access token: https://developers.facebook.com/docs/graph-api/reference/event/
Nevertheless I receive following error-response:
Unsupported get request. Object with ID '{eventid}' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api
I have tried with multiple events with the same results
In April 2018, following the Cambridge Analytics scandal, Facebook decided to greatly reduce the information available through Facebook API.
In particular regarding Events API, here the official statement.
Events API: Until today, people could grant an app permission to get information about events they host or attend, including private
events. This made it easy to add Facebook Events to calendar,
ticketing or other apps. But Facebook Events have information about
other people’s attendance as well as posts on the event wall, so it’s
important that we ensure apps use their access appropriately. Starting
today, apps using the API will no longer be able to access the guest
list or posts on the event wall. And in the future, only apps we
approve that agree to strict requirements will be allowed to use the
Events API.
After that change you will not be able to get events of Facebook Pages, using the Facebook API like in the old days.
You could be able to get the data of a page you own if you have user_event permission (https://developers.facebook.com/docs/graph-api/reference/user/events/) but your app need to pass the App Review process.
Source: https://newsroom.fb.com/news/2018/04/restricting-data-access/

Using FaceBook Sdk in my Unity Game (Login and User's FB_id)

I've been working with integration of Facebook sdk in my unity game. In the first page I kept a fb login option and I'm trying to fetch the player's fb_id(with which I will be making an online leaderboard). I'am facing two problems.They are:
Only my apps developers, test-users and owner(me) can login only first time. If i clear my apps data I face a hash key validation problem. There will be a screenshot below.
I need the fb_ids of all users . But I am getting only the fb_ids of people who has roles (owner, developer and test users) . How can I get the fb_ids of all users?
NB: My game is published in google play and reviewed by Facebook with necessary permissions.
Google Play Link: https://play.google.com/store/apps/details?id=com.BLI.CatchTheBaby&hl=en
Facebook SDK does not allow you to get data of all users.
Their API returns only your friends ids,name etc. Here is an online tester of Graph API: https://developers.facebook.com/tools/explorer/
If you want to get all users FB IDs you have to store them on your online database like this: When user is doing his first login to Facebook from your app, you are sending returned id to database by some kind of webrequest. Then you can fetch data with all users IDs.

Facebook Messenger Platform: how to get user specific information?

I'm trying the recent released Facebook Messenger Platform and so far so good. Everything worked well and I was able to create a echo bot.
But I'm wondering how I could identify this user that started chatting in my page. For example, when a user started chatting I get a PID user (page specific user id).
Making the follow request to Facebook Graph API:
GET https://graph.facebook.com/v2.6/{PAGE_SPECIFIC_USER_ID}
I discovered that I can just ask for the following fields: first_name,last_name and profile_pic.
So my question is, how could I discover if this user is a current customer of my business page? Is there another way of querying more information (like e-mail and real facebook user id)?
Facebook has updated the messenger platform API (2016-07-01) and introduced a new feature called Account Linking. This can be used to identify a user who has created an account on your website via Facebook Login and you can link the two accounts. Facebook login has its own set of permissions which can be used to get a lot more information via Facebook graph API. You can find the complete list here.
Currently, there's no way to do this. The best way would be to prompt the user to enter their information in chat or give them a link to a mobile login page or some other way of linking their account to the chat.
Messenger Platform 2.0 introduce "ID Matching API" ,that will solve the problem.
https://developers.facebook.com/docs/messenger-platform/connecting-accounts
you can retreive a user information like below using fbmq library https://github.com/conbus/fbmq
# this method will occur when a message received from user
#page.handle_message
def message_handler(event):
user_profile = page.get_user_profile(event.sender_id)
print(user_profile) #first_name, last_name, profile_pic, gender ...

How can I track performance of facebook mobile app ad campaigns

As we know, we can use marketing API of facebook to check our campaigns.
But these statistics are aggregated, can not understand my audiences of ads.
Whether there is API to fix this problem?
I just want to get device level info from every ads.
Like:
Get IDFA (advertising ID in iOS) have been installed Application by clicking My facebook ads.
User level data is not accessible due to user's privacy. However, you can get some aggregated numbers with more detail by using Facebook Analytics or the /app_insights endpoint. https://developers.facebook.com/docs/graph-api/reference/application/app_insights

How to find facebook account with emailid by using api

I am developing an application, in my application there is a requirement , to find the users profile based on EmailID in facebook and twitter using api's.
I have tried a lot but did not found any results
but when i using third party licensed api's they were getting the data from various social networking sites using emailid as input
Can any one please suggest me how to solve this
Facebook has removed the ability to search by email this year. It is covered in this stack overflow thread.
Even using FQL, it is neccessary for your app to have been approved by a user before it is able to access a user email. In the case where they have opted in all that is required is
SELECT email FROM user WHERE uid=FRIEND_ID
in the facebook FQL console.
Twitter has a similar rule for their API, and trying to search for user#email.com will end up looking for a user #email.com.
You will need to find other methods to search for users; searching by email tends to only be open in the app that the API creators made, and not for general public use.