Friendbuy Destination

Segment makes it easy to send your data to Friendbuy (and lots of other destinations). Once you've tracked your data through our open source libraries we'll translate and route your data to Friendbuy in the format they understand. Learn more about how to use Friendbuy with Segment.

Getting Started

Setting up Friendbuy is very simple! Just login to your Friendbuy account, go to Integration Code > and copy the Site ID above the snippet box. Then paste it into your Friendbuy Destiation setting back in the Segment UI as seen in the gif below:

This Destination allows you to:


In order to load specific widgets on your various web pages, you can configure your settings to map your named .page() call(s) to your desired Friendbuy Widget(s). You will also be able to configure a number of optionally advanced widget configurations such as auto delay and custom parameters. Please see the following gif for example:

There are two types of Widgets you can map to your .page() calls:

  • Site Wide Widgets

    • These types of widgets are recommended by Friendbuy to load on all your webpages. If you wish to use these types of widgets, you can add them under the Side Wide Widgets setting. NOTE: You are NOT required to map a site wide widget if the Call To Action type is a ribbon served by Friendbuy. This type of overlay widget will just load when we boot up Friendbuy’s library.
  • Other widgets

    • All other widgets will fall under this category whereby you can map the name of a unique Segment .page() call to a widget ID.

NOTE: If you have mapped a site wide overlay widget loads on every .page() call, even if we have loaded a different widget on the page that you have explicitly mapped.


When you call .identify(), we will send the following mapped traits:

Segment TraitsFriendbuy Standard Fields

Here is a sample Javascript .identify() call with the all the standard traits:

analytics.identify('2', {
  firstName: 'Buzz'
  lastName: 'Lightyear',
  email: '',

NOTE: Friendbuy does not accept any custom traits.

Stripe and Chargebee Customer ID

If you are integrated with Stripe or Chargebee and would like to send those IDs to Friendbuy, you can pass them as integration specific options:

analytics.identify('2', {
  firstName: 'Buzz'
  lastName: 'Lightyear',
  email: '',
}, {
  integrations: {
    Friendbuy: {
      stripeCustomerId: <>,
      chargebeeCustomerId: <>

Track / Order Completed

This Destination accepts only Order Completed events as decribed in our ecommerce spec.

Friendbuy has a concept of Order Tracking and Product Tracking where the former describes how to send data about the top level order whereas the latter documents instructions on sending data about each of the product within that order.

When sending the order details, we will make the following translation:

Segment PropertiesFriendbuy Standard Fields
order_idid REQUIRED

Then we will iterate over each item in your properties.products and send the following mapping:

Segment PropertiesFriendbuy Standard Fields

NOTE: You can optionally specify if the customer who made the order is a new customer by passing new_customer under your integration specific options:

  integrations: {
    Friendbuy: {
      newCustomer: true,

Supported Sources and Connection Modes

📱 Device-mode
☁️ Cloud-mode

To learn more about about Connection Modes and what dictates which we support, see here.


Segment lets you change these destination settings via your Segment dashboard without having to touch any code.

Site ID

This is your Site ID. It is used to identify your account in our platform so we can properly attribute referral data. You can find your Site ID in the in Friendbuy web application at Settings > Integration Code

Site Wide Widgets

By default, Friendbuy recommends you add a site wide overlay widget. You can enter any of these site wide widgets here and we will load them any time we receive a .page() call. Note: If you have custom widgets mapped to named pages in the Widgets setting and you have provided a site wide widget, we will load both.

Page Widgets

Map your page calls to specific FriendBuy Widgets.

Adding Friendbuy to the integrations object

To add Friendbuy to the integrations JSON object (for example, to filter data from a specific source), use one of the 2 valid names for this integration:
  • FriendBuy
  • Friendbuy

  • Questions? Need help? Contact us!
    Can we improve this doc?
    Email us:!