Account Linking

Never Forget a User

Account Linking lets you recognize bot users as users of your site and vice versa. This allows for a more unified, customized experience.

With Account Linking you can

  • Let users know when an order has shipped
  • Remind users to buy what they've forgotten in their carts
  • Remember user preferences
  • Recognize Gold or Platinum users
  • Streamline customer service

as well as access a fuller picture of user behavior and preferences.

Implementation

Facebook offers a secure protocol for linking an external account to a user's Messenger account. This allows for a more personalized experience, and requires that Snaps have access to an API with which we can access user account information — such as recent orders, shipping status, etc.

Sign in and sign up will work as follows:

  1. User will click out of messenger to a specialized Log In / Sign Up webview.

  2. On that page, you'll accept the following two parameters passed from the Messenger Platform:

<redirect_uri>

<account_linking_token>

  1. Once sign in is complete, redirect users to the location provided by <redirect_uri> and append an <authorization_code> parameter to confirm linking.

You need to pass back the <account_linking_token> as part of the redirect scheme.

The authorization code should be the user’s account number, or whatever information is needed for Snaps to access your API.

Snaps will register your URL as a Log In Button with Facebook, which will open a webview for users to complete your authorization flow within Messenger. Upon success, Snaps will receive this authorization code in an event from the Messenger API.

For full documentation, click here.