Opt-in Subscriptions

There are many cases when you may want to add user opt-ins to receive updates via FB Messenger. The Snaps' SDK allows you to wrap two primary FB Messenger plugins to achieve the opt-in use cases.

Send To Messenger Plugin

You can discover the Send To Messenger Plugin docs here. To leverage our SDK, you will implement our SDK and add a JavaScript snippet on your page that looks something like this:

// add a Send to Messenger button on your web site
options = {
  messenger_app_id: messengerAppId,
  page_id: messengerPageId,
  'data-ref': referralId,
   color: 'blue',
   size: 'xlarge',
   cta_text: 'KEEP_ME_UPDATED',
   bind_to_div: '#snaps-insert-here',
   store_user_properties: { // any user property data you want to pass to snaps
     orderNumber: 'x1d2f1',
     brandUserId: 'uniqueUserIdForYourSite',
     zip: 12345,
     vip: true
   }
};

sp('plugin:stm', options);

Messenger Checkbox Plugin

You can discover the Messenger Checkbox Plugin docs here. To leverage our SDK, you will implement our SDK and add a JavaScript snippet on your page that looks something like this:

var checkbox_settings = {
  "bind_to_checkbox": ".snaps-bind-here",
  "bind_to_button": "#edit-submit--2",
  "messenger_app_id": "2222166228014810",
  "page_id": "183709758368365",
  "origin": "https://snaps.com/",
  "allow_login": true,
  "size": "xlarge",
  "skin": "light",
  "ref": {
     snaps_referral_id: referralId,
     store_user_properties: { // any user property data you want to pass to snaps
       orderNumber: 'x1d2f1',
       brandUserId: 'uniqueUserIdForYourSite',
       zip: 12345,
       vip: true
     }
   },
  "center_align": false
};

sp('plugin:checkbox', checkbox_settings);