Connect with us

FACEBOOK

Simplifying analytics for Messenger bots

Published

on

For the busy developers or lazy readers: We have a new toy for you. Go and have fun! 🤝

It’s conventional wisdom that you can’t improve something that you can’t measure. Product usage data is not only interesting and nice to have, but an important foundation for making the right product decisions and assessing the effectiveness and ROI of your Messenger bot compared to other channels.

Example bot funnel for an e-commerce flow

For traditional websites, there is a myriad of tools and services available that web developers can use. This article outlines the best practice for using Facebook Analytics for Messenger bots and introduces an npm package which is aimed at helping developers to make integration effortless.

Experienced bot developers know that launching a conversational experience is only the start of the journey to improving your service over time — based on real user interactions. It’s a tough, but rewarding challenge because conversations are not deterministic by nature like graphical user interfaces. In other words, the bandwidth of user actions is much wider than on traditional websites where the user can scroll, click pre-defined buttons, and write text in known input fields or text areas.

On the Messenger platform, the most integrated way to log bot activity is to use Facebook Analytics (FBA) in form of custom app events through the app activities endpoint. Although logging an event to FBA only requires a simple API call, many bot developers skip this step and launch Messenger experiences without having a measurement framework in place.

The Partner Engineering team at Facebook has therefore set out to simplify event logging for Messenger bots. The result is a thin integration layer that sits between your Messenger bot and Facebook Analytics.

Meet the messenger-analytics package

The messenger-analytics package offers a simple interface to Facebook Analytics (FBA) for Messenger bots. It provides a thin integration layer as well as a collection of commonly used bot events to give you a basic idea of useful metrics.

Facebook Analytics (FBA) is a people-first analytics tool for an omni-channel world. It can be used as a standalone logging solution for your Messenger bot or in addition to other analytics software. FBA is closely integrated with the Facebook ecosystem, including Ads Manager and the Facebook Pixel. This allows you to optimize your campaigns for specific actions in the bot and to combine pixel data from your website with Messenger bot activity.

A question that Facebook Analytics can answer: “How many people purchased an item on my website after having been consulted by the bot beforehand?”

The Facebook Messenger platform automatically logs certain events for your bot, for example “message sent” and “message received”. These events are logged on the app-level and can be visualized in Facebook Analytics (FBA).

In addition to these automatic events, FBA also supports the logging of custom events which enable you to visualize user journeys and track the performance metrics of your choice. The messenger-analytics package helps you to log custom events in Facebook Analytics.

Installation

npm install --save messenger-analytics

Import

const FBA = require("messenger-analytics");

Creating an event logger

Create a logger using the app and page ID associated with your bot.

const logger = new FBA.Logger({
appID: YOUR_APP_ID,
pageID: YOUR_PAGE_ID,
});

Logging events

The simplest form of logging an event is to provide an event name and the user identifier (PSID). You can either use an event name defined in this module or choose an arbitrary name.

Note: Whenever possible and applicable, use the so called predefined app events in FBA.EventNames.Predefined. They are utilized across the Facebook ecosystem and are needed for campaign attribution and optimization in Ads Manager. Given the significance of these events for other Facebook products and services, it is advisable to treat them as first choice.

// Using a predefined event name (required if you want to report on a specific metric in Ads Manager)
logger.logEvent(
FBA.EventNames.Predefined.Purchased,
"USER_PSID",
).then(() => {
console.log("Event successfully logged to FBA.");
}).catch((err) => {
console.error(err);
});// Using a custom event name
logger.logEvent(
"subscribed_sports_news",
"USER_PSID",
).then(() => {
console.log("Event successfully logged to FBA.");
}).catch((err) => {
console.error(err);
});

You may also attach parameters to an event. These parameters can be used for filtering, segmentation, and campaign reporting. Predefined events have specific parameter definitions which need to be followed if you want to log purchases and see the purchase value and currency in Ads Manager, as an example. The parameter definitions can be found in the App Events API event structure.

On top of these standard parameters, you may also log additional custom parameters. Parameters for custom events don’t have to follow any naming convention.

// Purchase event with 3 standard 1 custom parameters
logger.logEvent(
FBA.EventNames.Predefined.Purchased,
"USER_PSID",
{
_valueToSum: 87.90, // standard parameter, defaults to 1
fb_num_items: 3, // standard parameter
fb_currency: "EUR", // standard parameter
custom_var: "hello_world", // custom parameter
}
).then(() => {
console.log("Event successfully logged to FBA.");
}).catch((err) => {
console.error(err);
});

These parameters can then be used in FBA to filter your results:

Filtering events by parameters

Platform and language availability

We chose to publish this analytics package for bots built on NodeJS (written in JavaScript) first. Depending on popularity and demand, we might follow up with implementations for other popular “bot builder languages” like PHP, C#, Ruby, or Python. If you have a preference, let us know in the comments! 🙂 In the meantime, you can simply send your requests straight to FBA using our the analytics quick start guide.

Facebook Analytics for Messenger is MIT licensed.

Messenger Developer Blog

FACEBOOK

How Our Focus on Privacy Impacts Developers

Published

on

Today, we’re sharing some of the changes we’ve made to our privacy program over the past year and examples of the new ways we’re operating to ensure we protect people’s privacy. At Facebook we are committed to building a safer, more sustainable platform to strengthen trust with people and continue to drive long-term value for our developers. Simply put, protecting the privacy of the people who use our products is a responsibility we share with all developers on our platform.

We’ve made changes to put privacy at the core of everything we do. The new Platform Terms and Developer Policies are a starting point to ensure businesses and developers clearly understand their responsibility to safeguard data and respect people’s privacy when using our platform and tools.

We’ve also continued to refine and streamline our App Review process which will ensure consistency for all developers. This includes changes that help developers build business solutions and tools as well as have additional control over the data permissions they request and the ability to remove them when no longer needed.

Finally, we introduced Data Use Checkup, a new annual workflow to drive accountability for all Facebook platform developers. With Data Use Checkup, developers are required to review the permissions they have access to and commit that their API access and data use comply with the Facebook Platform Terms and Developer Policies in order to keep their API access.

In addition to simplifying and clarifying developer responsibilities, we’re also proactively taking action against companies and individuals who abuse our platform. Earlier this month, we filed a lawsuit against two companies that used scraping to engage in an international data harvesting operation, and a few weeks ago we took action against two companies operating fake engagement services.

These improvements are intended to help create a better privacy foundation for developers and we encourage all developers to build experiences using a privacy-first approach, with principles such as data minimization as their guide.

As a reminder, developers will be required to complete Data Use Checkup within the next several months in order to maintain API access. If you have yet to go through Data Use Checkup, you’ll be receiving a Developer Alert triggering an email to your app’s administrators and notification in your App Dashboard, notifying you to complete the process.

To prepare for the process, make sure you’ve updated contact details and app administrator designation for each app within your organization. You can also learn more on the new Platform Initiatives Hub.

We know user privacy is just as important to our developer community as it is to us. Thank you for continuing to partner with us as we build a safer, more sustainable platform.

Facebook Developers

Continue Reading

FACEBOOK

Preparing for Apple’s App Store Data Disclosure Requirements

Published

on

To support our developer and advertising partners with the upcoming iOS 14 App Store data disclosure requirements, we have consolidated previously released public information that explains Facebook’s data collection practices for the Facebook SDK to make it easier for you as you fill out the App Store Connect questionnaire when it’s released.

Facebook SDK

To provide functionality within the Facebook SDK, we may receive and process certain contact, location, identifier, and device information associated with Facebook users and their use of your application. The information we receive depends on what SDK features 3rd party applications use and we have structured the document below according to these features.

App Ads, Facebook Analytics, & App Events

Facebook App Events allow you to measure the performance of your app using Facebook Analytics, measure conversions associated with Facebook ads, and build audiences to acquire new users as well as re-engage existing users. There are a number of different ways your app can use app events to keep track of when people take specific actions such as installing your app or completing a purchase.

With Facebook SDK, there are app events that are automatically logged (app installs, app launches, and in-app purchases) and collected for Facebook Analytics unless you disable automatic event logging. Developers determine what events to send to Facebook from a list of standard events, or via a custom event.

When developers send Facebook custom events, these events could include data types outside of standard events. Developers control sending these events to Facebook either directly via application code or in Events Manager for codeless app events. Developers can review their code and Events Manager to determine which data types they are sending to Facebook. It’s the developer’s responsibility to ensure this is reflected in their application’s privacy policy.

Advanced Matching

Developers may also send us additional user contact information in code, or via the Events Manager. Advanced matching functionality may use the following data, if sent:

  • email address, name, phone number, physical address (city, state or province, zip or postal code and country), gender, and date of birth.

Facebook Login

There are two scenarios for applications that use Facebook Login via the Facebook SDK: Authenticated Sign Up or Sign In, and User Data Access via Permissions. For authentication, a unique, app-specific identifier tied to a user’s Facebook Account enables the user to sign in to your app. For Data Access, a user must explicitly grant your app permission to access data.

Note: Since Facebook Login is part of the Facebook SDK, we may collect other information referenced here when you use Facebook Login, depending on your settings.

Device Information

We may also receive and process the following information if your app is integrated with the Facebook SDK:

  • Device identifiers;
  • Device attributes, such as device model and screen dimensions, CPU core, storage size, SDK version, OS and app versions, and app package name; and
  • Networking information, such as the name of the mobile operator or ISP, language, time zone, and IP address.

Audience Network SDK

We may receive and process the following information when you use the Audience Network SDK to integrate Audience Network ads in your app:

  • Device identifiers;
  • Device attributes, such as device model and screen dimensions, operating system, mediation platform and SDK versions; and
  • Ad performance information, such as impressions, clicks, placement, and viewability.

Facebook Developers

Continue Reading

FACEBOOK

Messenger API to support Instagram

Published

on

Today, we are announcing updates to the Messenger API to support Instagram messaging, giving businesses new tools to manage their customer communications on Instagram at scale. The new API features enable businesses to integrate Instagram messaging with their preferred business applications and workflows; helping drive more meaningful conversations, increase customer satisfaction and grow sales. The updated API is currently in beta with a limited number of developer partners and businesses.

Instagram is a place for emerging culture and trend creation and discovering new brands is a valuable part of this experience. Messaging plays a central role in helping people connect with brands in personal ways through story replies, direct messages, and mentions. Over the last year, total daily conversations between people and businesses on Messenger and Instagram grew over 40 percent. For businesses, the opportunity to drive sales and improve customer satisfaction by having meaningful interactions with people on Instagram messaging is huge.

Instagram is a platform for community building, and we’ve long approached it as a way for us to connect with our customers in a place where they are already spending a lot of their time. With the newly launched Messenger API support for Instagram, we are now able to increase efficiency, drive even stronger user engagement, and easily maintain a two-way dialogue with our followers. This technology has helped us create a new pipeline for best-in-class service and allows for a direct line of communication that’s fast and easy for both customers and our internal team.” – Michael Kors Marketing

Works with your tools and workflows

Businesses want to use a single platform to respond to messages on multiple channels. The Messenger API now allows businesses to manage messages initiated by people throughout their Instagram presence, including Profile, Shops, and Stories. It will be possible for businesses to use information from core business systems right alongside Instagram messaging, enabling more personal conversations that drive better business outcomes. For example, businesses integrating with a CRM system can give agents a holistic view of customer loyalty. Furthermore, existing investments in people, tools, and workflows to manage other communication channels can be leveraged and extended to support customers on Instagram. This update will also bring Facebook Shops messaging features to the Messenger API so businesses can create more engaging and connected customer experiences.

To get started, businesses can easily work with developers to integrate Instagram messaging with their existing tools and systems.

Increases responsiveness and customer satisfaction

Customers value responsiveness when they have questions or need help from businesses. For the first time on Instagram, we’re introducing new features that will allow businesses to respond immediately to common inquiries using automation, while ensuring people are seamlessly connected to live support for more complex inquiries. One of our alpha partners, Clarabridge, reported their client brands had improved their response rate by up to 55% since being able to manage Instagram DMs through their platform.

The updates to the Messenger API are part of our overall effort to make it easier for businesses to reach their customers across our family of apps.

Messenger API support for Instagram is currently in beta with a focus on providing high quality, personalized messaging experiences on Instagram while increasing business efficiency. Adidas, Amaro, Glossier, H&M, MagazineLuiza, Michael Kors, Nars, Sephora and TechStyle Fashion Group and other consumer brands are already participating in the beta program. We are excited about early results some businesses saw during alpha testing, including higher response rates, reduced resolution times, and deeper customer insights as a result of integrations. We’re also testing with a limited number of developer partners; and are delighted at the initial response.

On average, brands have saved at least four hours per agent per week by streamlining social community management within the Khoros platform, plus shortened response rates during business hours — which is crucial to meet as customers who message brands on social media expect a quick reply.” – Khoros

If you are a business interested in utilizing the API post-beta, please sign up for our business waitlist. If you are a developer, please sign up for our developer waitlist.

Facebook Developers

Continue Reading

Trending