Skip to contentSkip to navigationSkip to topbar
On this page
Looking for more inspiration?Visit the
(information)
You're in the right place! Segment documentation is now part of Twilio Docs. The content you are used to is still here—just in a new home with a refreshed look.

Friendbuy Destination


Destination Info
  • Accepts Page, Identify and Track calls.
  • In Device-mode, refer to it as FriendBuy in the Integrations object
Connection Modes
Device-modeCloud-mode
Web Web
Mobile Mobile
Server Server

Friendbuy is a referral marketing and campaign optimization platform.


Getting Started

getting-started page anchor
  1. Log in to your Friendbuy account and go to Integration Code.
  2. Copy the Site ID above the snippet box.
  3. Log in to your Segment workspace, click Catalog and select the Destinations tab.
  4. Search for "Friendbuy" and click it in the catalog, then click Configure.
  5. Select the Segment data source you want to send to Friendbuy.
  6. On the next page that appears, click the Site ID setting, and paste the Site ID you copied in step 2, and click Save.

This destination allows you to:


To load specific widgets on different web pages, you can configure your settings to map your named Page call(s) to specific Friendbuy Widget(s). You can also configure a several optional advanced widget configurations(link takes you to an external page) such as auto delay and custom parameters.

Friendbuy has two Widgets you can map to your Page calls:

Site Wide Widgets

Friendbuy recommends you to load these widgets on all your web pages. To use these widgets, you can add them under the Side Wide Widgets setting.

(information)

Info

You don't need to map a site wide widget if the Call To Action type is a ribbon served by Friendbuy. This overlay widget loads when Segment loads the Friendbuy 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.

(information)

Info

If you have mapped a site wide overlay widget, it loads on every .page() call.


When you call .identify(), Segment sends the following mapped traits:

Segment TraitsFriendbuy Standard Fields
userIdid REQUIRED
emailemail
firstNamefirst_name
lastNamelast_name

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

1
analytics.identify('2', {
2
firstName: 'Buzz'
3
lastName: 'Lightyear',
4
email: 'captain.lightyear@toystory.com',
5
});
(information)

Info

Friendbuy does not accept custom traits.

Stripe and Chargebee Customer ID

stripe-and-chargebee-customer-id page anchor

If you integrate with Stripe or Chargebee and need send those IDs to Friendbuy, you can pass them as integration specific options:

1
analytics.identify('2', {
2
firstName: 'Buzz'
3
lastName: 'Lightyear',
4
email: 'captain.lightyear@toystory.com',
5
}, {
6
integrations: {
7
FriendBuy: {
8
stripeCustomerId: <email@stripe.com>,
9
chargebeeCustomerId: <email@chargebee.com>
10
}
11
}
12
});

Track / Order Completed

track--order-completed page anchor

This Destination accepts Order Completed events as described in the Segment ecommerce spec.

Friendbuy has a concept of Order Tracking(link takes you to an external page) and Product Tracking(link takes you to an external page) 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 you send order details, Segment makes the following translation:

Segment PropertiesFriendbuy Standard Fields
order_idid REQUIRED
context.traits.emailemail
revenueamount
couponcoupon_code

Then Segment iterates over each item in your properties.products and send the following mapping:

Segment PropertiesFriendbuy Standard Fields
skusku
priceprice
quantityquantity
(information)

Info

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

1
integrations: {
2
FriendBuy: {
3
newCustomer: true,
4
}
5
}

Segment lets you change these destination settings from the Segment app without having to touch any code.

Property nameTypeRequiredDescription
Site IDstring
required

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 Widgetsmixed

Optional

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 Widgetsmixed

Optional

Map your page calls to specific FriendBuy Widgets.