Facebook Analytics: user properties and logged events using graph API - facebook

I have facebook app (Messenger Bot App) where I am logging custom events for each user using the graph API endpoint /application/activities/
The events are logged perfectly. What I want to do is creating custom properties for my messenger bot users so I could segment the app data using this properties as described on: https://developers.facebook.com/docs/analytics/properties
So what I did was using the graph API endpoint /application/user_properties/ to create the properties.
It returned "success", the properties were created perfectly and I can see them as possible filters for segmentation on the app analytics page. But this filters always return no results!
I think the problem is: events are logged for specific "fb_user_id" but in user properties endpoint there is nothing to relate "fb_user_id" with the newly created properties.
on FB documentation https://developers.facebook.com/docs/analytics/properties it is stated:
When you set a user ID, this ID is stored on the user's device and
included in app events logged from that device.
This means when calling the event logging endpoint there should be a parameter to hold the user id created by me when setting the user properties. But I am not able of finding this parameter. I tried send it as custom_events["_app_user_id"] but results remains the same and on app analytics page I can see the filters but it is useless.

Whereas custom_events["_app_user_id"] is the field for app event payloads, it looks like the field is custom_events["user_unique_id"] for user property payloads.

Related

Can I transform a user-id to PSID? - Facebook API Graph

Context: I'm building a webhook with NodeJS to get events from Facebook Page with my Facebook App. These events are: feed, mention (when a user tags the page on his wall) and message. I can get all events without problem. In all events I need to identify the user who write. When the users write a post or message in the page I get an ID (PSID) but when the user write a post on his wall tagging the page I can't get PSID, this is obvious because he isn't in the page scope. The only I get from this event is user-id from post-id.
I have tried the following:
I used this endpoint GET: /<user-id>/ids_for_pages as indicated in the documentation. This doesn't work for me because I would need that the pages are in my business administrator and this isn't possible because I need this webhook to manage many pages to many companies.
I used this endpoint GET: /<psid>?fields=name,id for events of type feed and messages (from Messenger) into the page but this gives me only PSID again.
Note: In my DB I save long-lived token of my page, ASID of the site owner and Page ID when my user does the login in the UI.
My questions:
Is possible transform user-id to PSID?
Can I get user-id through the PSID?
If you have a better idea to unify IDs when is the same user, I would like to know it. If this isn't possible I would also like know it.
My Goal: Each user event goes to the same case for the same user in my API, for this reason if the user is the same when tags the page and/or write a message in the page the idea is to identify him like same user and not like new case.

How to retrieve Job Applications from Facebook Page using graph API

I wanted to retrieve job applications from Facebook page using graph API. In the graph explorer i have applied my page Id in node. where we can see several fields like post, conversations, likes... Now if a person clicked "Apply now" button on facebook page. Facebook will capture the vital information to prepare resume. Now i wanted to pull those information against the job post. How is it possible using graph api https://developers.facebook.com/tools/explorer/
I believe that facebook requires you to set up a recruiting manager to access the jobs feed via that user instead of accessing the job information via the graph api for a page. This ensures that the business that owns the page has one person assigned to handling the job interactions and that the application information is being kept secure.
https://developers.facebook.com/docs/pages/jobs-xml/how-to/

Facebook: What is the graph api for subscribing user to the Facebook (webhook) for real time change

I am referring following links to the Facebook documentation for real time subscription.
https://developers.facebook.com/docs/graph-api/webhooks
https://www.facebook.com/marketingdevelopers/videos/883648801749520/
For the page, the graph api v2.6/{page-id}/subscribed_apps is used for subscribing the page to the app.
I am looking for the graph api for subscribing user to the app for the real time changes.
I am looking for the graph api for subscribing user to the app for the real time changes.
There is no such endpoint.
For updates from users, you don’t need to create an individual subscription for every single one, like you need to do with pages.
You just do the general setup, that subscribes your app to updates for certain fields/edges of the user object. You then will get updates automatically for the users of your app, when a change on those happens (provided that the users gave your app the necessary permissions to read that kind of data.)

Facebook Graph API Events ticket_uri not working

When fetching a Facebook event from the Facebook Graph API, there is a field for the ticket_uri
The response always looks like this:
https://www.facebook.com/ajax/events/ticket.php?event_id=1461866457391623&source=12&ext=[aBigNumber]&hash=[randomhash]
which basically works in the current browser session, but does not work when saved and used somewhere else, like an other browser.
Is there a solution to redirect the user to the correct "Book now" url
That's the intended operation of that field - It's intended to be used by the current session user (i,e whose access token you're using) and contains a user/session specific hash which will expire -
If you want to link arbitrary other users (i.e. who aren't using your app) to the event for ticket purchasing reasons, the only alternative is to link them to the Event on Facebook.com and have them click it themselves

Can't post actions to a Facebook event

I have my server side code create an event on Facebook, using a Facebook application user I created.
Then, I want mobile users of my app, that logs in to my app using FB connect, to be able to publish actions on that even's wall.
I tried doing it using code,curl or graph explorer, but nothing seems to work.
I suspect the only option is to publish actions using the user that created the event.
When I Post to a link like this:
https://graph.facebook.com/EVENT_ID/APP_NAMESPACE:ACTION
With the object as a parameter as well, I get the following error:
Requires a valid user is specified (either via the session or via the API parameter for specify
When I post to link like this :
https://graph.facebook.com/EVENT_ID/feed/APP_NAMESPACE:ACTION
I get an error:
Unknown path components: /APP_NAMESPACE:ACTION
Any way to achieve that ?
The error message is telling you that an event's /feed connection has no connection of /APP_NAMESPACE:ACTION type. This error message is correct.
Posting actions to or as a Page, Event, Group is not possible, nor is it possible to post actions to a friend's Timeline - only users can post actions, and only to their own timelines.
See the Open Graph Mechanics part of the docs, it shows that users perform an action on an object. What you're trying to do is having a user take an action, and then post that to an event wall - that's not supported