In our social messaging quick start guide we detail working with facebook's send to messenger plugin it is also possible to work with the customer chat plugin.
Chat plugin Bottom Right
Review the Facebook messenger Docs for embedding a plug-in and opt-ing in users. You can find these in the discovery and re-engagement section. Follow the facebook messenger docs for embedding the customer chat plugin on your site to opt-in users for messaging. We are also assuming you already have the xtremepush SDK on your site (if not details on deploying SDK here). You will need to modify the plugin embed code to allow syncing of opted in users to xtremepush. To be able to connect the user to xtremepush and enable you to message them on FB Messenger via your FB messenger channel you need to grab the xtremepush id and set the plugins ref attribute to be equal to the xtremepush id.
See highlighted line below where we use xtremepush SDK method to get ID. Setting this attribute is key as once set it means the xtremepush id is available in your chatbot when the user opts in.
var fbPluginElements = document.querySelectorAll(".fb-send-to-messenger[page_id='XXXXXXXXXXX']");
if (fbPluginElements) {
for (i = 0; i < fbPluginElements.length; i++) {
fbPluginElements[i].setAttribute('ref', xtremepush('get','device_info').id );
}
}
Once the users id is pushed to your chatbot as part of the opt-in then you can easily sync your user with the chatbot. If you have your own purpose built chatbot follow integration guide in the quick start guide. If you use a platform like chatfuel you can also integrate by adding a JSON API block to your chatbot flow.
Comments
0 comments
Article is closed for comments.