I am creating a chatbot using messenger in python but I don't know how to get the geolocation from the facebook user (latitude, longitude). I saw that I had to use graph API but the field status does not seem to work. Would you have a query example? Thanks in advance!
[Update with the current status about how to solve this]
Location Quick reply have been deprecated and removed since end of june 2019.
They're supposed to announce a new way of achieving the same behavior but nothing so far 6 months later.
Facebook recommends asking for user's address in a textual form.
This means that if you use an API consumming GPS coordinates you now must use an address to GPS conversion service.
You could think that using a webview with a "get geolocation" button would do the trick but this feature is blocked on all desktop browsers. If the iframe content isn't on the same domain you cannot get geolocation data. Still it works on mobile (as it's not just a simple iframe but a full webview).
Basically, at the time of this writting, you have no much way to achieve the same as the "get position" quick reply behavior.
The only solution is to ask the user's address in a textual way and convert it to GPS coordinates (if you need them).
You can use the location quick reply:
https://developers.facebook.com/docs/messenger-platform/send-messages/quick-replies#location
Related
I'm working on a Facebook Messenger bot for a client and I'm trying to give the users a map with directions to the client's location. I know FB has a button to get the user's location, but I'm not sure how to show the directions.
Any ideas how I might go about doing that because I don't believe Facebook provides something like that by default or as a template message (I could be wrong?).
There is no template for this afaik, but you could just create a picture of the map (and directions) server side. Sending pictures with the bot is no problem at all. It all depends on how exactly you want to show directions, but i guess there is no other option. You can include a list too, showing all the steps/turns to get to the destination.
I am new to this. I am looking for a way to search user in specific location but it turn out the results come from no where.
I have tried this
/search?q=micheal&type=user&location=New+York
But the results shows people from like India. I wonder why it becomes like that. Each time I refreshing the link it shows the same set of data.
I am using php sdk with app version 2.8.
Please help me. Thanks in advance.
There is no way to search for users by location, you can only search for users by name. That is why people from India show up too. Check out the docs, there is no mention of using the location parameter with the user search, especially not with a location name. Location search is only possible for Places, with latitude/longitude.
I have developed an app that retargets customers when browsing a website and I have some problem with UTM tracking and Google Analytics.
For example if a client gets a customer to click on a FB ad and lands on their website they will have a custom FB utm. After browsing the website my app will display a pop-up and when a client clicks on it he receives my custom UTM.
The problem is that clients loose conversion rate data for the original traffic source and I need to figure out a solution.
Help is very much appreciate
It's not a good practices track with utm inside your site, if the pop-up is on the same domain, dont do it?
In you example, if the user comes from FB, yes, you need to tack with the utm, but the pop up is on your site... lets check the option?
If the asnwer is yes, try to track the user with a Custom Dimention on a Session Level, that will solve almost all your problems.
If the answer is no, you can only store a single UTM per sessions, that means that there is no option to avoid the overwriting the UTM, even consider the referal exclusion.
More about Custom dimentions:
https://support.google.com/analytics/answer/2709828?hl=en
I am not sure if the title of my post is right, spare me if it is wrong :)
I am using the latest facebook sdk with unity (Ver 4.2). When i call a fb.api request, i get the message "Nearby" whenever some facebook stuff is loading.
Scenario.
A share on fb/ connect with fb/ invite friends function, loads facebook.
At this point, there is a waiting dialog. Weirdly enough this waiting shows "Nearby" rather than waiting/loading. And i could not find any option to configure this.
I looked high and low, but could not find a place where i could configure the default waiting message. Any suggestions?
You can modify Unity/Assets/Plugin/Android/res/value/strings.xml - modify <string name="com_facebook_nearby">nearby</string> entity. But I think it is not a solution. I guess that there is some kind of logic with place picking in the Unity Facebook SDK while login flow. But unfortunately I have not figure out it yet
I've been wondering, what list does facebook places use? Is it foursquare's one?
And if so, how does it work? Can I connect to foursquare's API and get nearby places with coordinates or something like that?
Thanks a lot!
Here is simple way to find out places near by given LAT and LONG as well as with specific word like-- Hotel,Bar etc:
http://maps.google.com/maps?f=q&sll=LATANDLONG&radius=500&q=SEARCHWORD&output=kml
It returns KML file ,and user can parse just like XML parsing.
Here's a link to FourSquare's documentation. Scroll down and look for "Venue methods." You supply the API the users longitude and latitude and Foursquare will return a list of nearby places.
http://groups.google.com/group/foursquare-api/web/api-documentation?pli=1
Also, here's a link to some sample code on how to implement the Foursquare API into your iOS app.
https://github.com/anka/bw_examples/tree/master/FoursquareIntegration
I believe facebook and the like foursquare built up their places mostly by user input.
In other words they might have started by buying a commercial dataset in a particular location. That's the seed data. Thereafter, users can add more places as they go. This way their database grew and now they have their own proprietary data about places.
If you go to either apps, you can search for a place, and if not found you get the option to add that place with address, category etc.
I am curious to know if Facebook uses any third party API for its Places feature.
For how it works, you can use Facebook Graph API which provides search.