I am trying to track the buttons clicks on facebook messenger bot. Does any one have any experience or tips on doing it.
Here is a portion of my JSON
buttons:[
{
type:'web_url',
url:'<link to my url>',
title:'Click me'
},
{
type:'phone_number',
title:'Call',
payload:'+1' + phoneNumber
}
]
I am primarily unable to track the phone_number, I can get away with few workarounds with the web_url on the target side.
Change the call me one to be a URL then on your website note that they clicked the button and redirect them to tel:+123456789012345
Related
I created a chatbot on Dialogflow which informs the user about the names of the members of my (extended) family and about where they are the living. I have created a small database with MySQL which has these data stored and I fetch them with a PHP script whenever this is appropriate depending on the interaction of the user with the chatbot.
I have integrated this chatbot to Facebook Messenger. My question is the following:
Can I directly trigger the Facebook messenger camera to be turned on through Dialogflow (and without using any other front-end camera)?
The reason I want to turn on the camera is to allow the user to take a photo of himself/herself and then I will process the photo with some computer vision libraries to infer if this person at the photo is a family member of mine. Obviously, I can simply create another basic front-end where I will turn on a camera whenever e.g. an intent called 'Camera' is triggered but I was wondering if can do this directly on facebook messenger.
The json response that I am receiving at my back-end from Dialogflow contains only the following UI capabilities:
"surface": {
"capabilities": [
{
"name": "actions.capability.MEDIA_RESPONSE_AUDIO"
},
{
"name": "actions.capability.SCREEN_OUTPUT"
},
{
"name": "actions.capability.AUDIO_OUTPUT"
},
{
"name": "actions.capability.WEB_BROWSER"
}
]
}
therefore my first impression is that turning on a camera directly through Dialoglfow (and Facebook Messenger) is not possible.
Am I right?
Well, you're right... but probably not for the reasons you think.
First, you're not going to be able to turn on the Facebook Messenger camera because you're not using Facebook Messenger. You're using the Google Assistant. Right now, the Google Assistant doesn't define a way to send an image to the Action you're interacting with. (It does work with Google Lens, but at this point, there is no way to get that to you.)
Second, you wouldn't actually "turn on" the camera. If the user sends you an image through the Messenger camera, you can process this by looking at the originalRequest field in the JSON you get on your fulfillment which should contain the message from Facebook which contains the image.
I have subscribed to the "feed" event with a webhook. So far I receive the following object when someone clicks on the "like" button of my page:
{"entry": [
{"changes": [
{
"field":"feed",
"value":{
"item":"like",
"verb":"add",
"user_id":11111111111111
}
}],
"id":"2222222222222",
"time":33333333
}],
"object":"page"}
Question 1: I wounder, is it possible to also get an event when the user "unlikes" the page?
Question 2: With this user_id, how can I get the user object from facebook? Is this the "real" facebook user id (i could not get an user object through the graph explorer so far) or is a page specific id of the user?
Thanks in advance!
EDIT: For Question 2, I just needed to add the page access_token to the request to get the user object.
I need to show map in facebook messenger bot. According to documentation following code should work but I only see message and place icon. Has anyone faced similar issue.
var messageData = {
recipient: {
id: userId
},
message: {
text: msg,
metadata: "DEVELOPER_DEFINED_METADATA",
quick_replies: [
{
"content_type": "location"
}
]
}
};
callSendAPI(messageData);
}
I was able to use this functionality without a problem on the IOS messenger app. The 'location' feature allows the user to send a their location to the bot. By default, it showed a map with 'Your Location' and 'Tap to view on map'.
I tried from the desktop and it gave an error indicating that locations are only usable in the app.
The bot is running at DMS Software Bot. Type 'quick reply' and hit location.
The source is at FB-Robot on github.
I was wondering if somebody can help me to solve this problem. I am trying to use FB.AppRequest() in Facebook SDK for Unity to implement an Invite feature . This is the code which I use.
if(FB.IsLoggedIn)
{
FB.AppRequest(
message: "Let's eat and be prosperous!",
title: "Let's eat and be prosperous!",
callback: InviteCallback
);
}
// ...
void InviteCallback(FBResult response)
{
// print response to console
}
The invitation dialog which I get can be seen here (link to Imgur). There is no "Invite" label on those buttons, and unsurprisingly, clicking them does not send any invitation. However, I can see the FBResult data, which is in the following format:
{
"request": "ABCD",
"to":
[
"EFGH",
"IJKL"
]
}
(more or less, since I haven't found a way to print new lines to Firebug console)
Additional information:
The result is the same regardless of the Sandbox setting.
The Unity version is 4.3.0f4
The Facebook SDK for Unity version is 4.3.4
The binary is hosted on an intranet server.
The Invite functionality in the Friend Smash example, hosted on the same server, doesn't work either. However, this is before the latest Friend Smash update (11/11/2013), whose Facebook functionalities I can't get to work yet.
Other Facebook functionalities (e.g. Init, Feed, API) work well.
I can't find any information about this on the internet. There are other questions about the Invite feature not working, but without the Facebook SDK for Unity, so I am not sure how they can be helpful to me.
Thanks a lot!
Just to clarify: the envelope button sends the invite, and it does so immediately when it is clicked.
If your app is in sandbox mode, people won't get notified when the request is sent. Look for the request in https://www.facebook.com/appcenter/requests as the recipient and see if the request shows up there.
If this still doesn't work, can you send me your fbresult data? unity-sdk#fb.com. thanks!
So Intuit charges for each active connections to QuickBooks. Therefore, I want to restrict the QuickBooks functionality in my application to premium users only.
Ideally when any user clicks the "Connect to QuickBooks" button and my RequestOAuthToken http handler is called, I want to check if the user is allowed to use QuickBooks. If that is the case, then the normal OAuth flow continue. If the user is NOT allowed, then I want to redirect the user to the upgrade page of my app.
Given that the "Connect to QuickBooks" button opens a new window (at least on desktop, I haven't tried on phone/tablets), the window should get closed, and the main window (my app) should redirect the user to the right page. And actually this is exactly what happens if the normal OAuth flow completes.
Now, I have tried a few different approaches but I couldn't get it working.
1) In my RequestOAuthToken, return a HTTP redirect to the plan page
2) In my RequestOAuthToken, return an html page with javascript logic to redirect to page
3) In my RequestOAuthToken, return HTTP redirect to a page with javascript logic to redirect to page
4) I haven't tried that one but could I somehow intercept the javascript click handler on the Intuit button. I'm not sure if that is an accepted practice.
Here is the piece a javascript I grabbed from the .Net sample:
try
{
var parentlocation = window.parent.opener.location.hostname;
var currentlocation = window.location.hostname;
if (parentlocation != currentlocation)
{
window.location = plansUrl;
}
else
{
window.opener.location.href = window.opener.location.href;
window.close();
}
}
catch (e)
{
window.location = plansUrl;
}
Help me out please.
I don't think you'll be able to do exactly what you're asking, but you can probably come close by taking a different approach.
Rather than trying to redirect them after they click the button, why not try to redirect them before they click it? e.g. when they try to get to the page that has the "Connect to QuickBooks" button it, check if they are a premium user there, and redirect them if they are not.
I don't think you'll be able to redirect them after they click the button because once they click that button, they get kicked over to Intuit's website and it's beyond your control at that point.
Clement, Keith has provided the answer we would want you to pursue. You may not alter the behavior of the Connect To QuickBooks button. It must be used as described in our documentation. Providing a link to a page that shows the Connect To QuickBooks buttons for your premium users and an upgrade message to non-premium users is the way to go.
I highly recommend that you visit http://docs.developer.intuit.com/0025_Intuit_Anywhere/0010_Getting_Started/0040_Publishing_Your_App and review all of the documentation there. If you develop with our guidelines and requirements in mind it will speed up the review process.
Tony Purmal
Developer Relations Engineer
Intuit Partner Platform