Friendbuy Destination
Friendbuy quick info
Friendbuy accepts Track, Page, and Identify calls. If you reference it in the Integrations object, call it “FriendBuy", or "Friendbuy”.
Friendbuy accepts device-mode data only from Analytics.js.
Getting Started
Setting up Friendbuy is very simple!
- Log in to your Friendbuy account and go to Integration Code.
- Copy the Site ID above the snippet box.
- Log in to your Segment workspace, click Catalog and select the Destinations tab.
- Search for “Friendbuy” and click it in the catalog, then click Configure.
- Select the Segment data source you want to send to Friendbuy.
- 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:
- Map your Page calls to facilitate Widget Management
- Map your Identify calls to facilitate Customer Tracking
- Map your Track calls to facilitate Order Tracking and Product Tracking
Page
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 such as auto delay and custom parameters.
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.
Identify
When you call .identify()
, we will send the following mapped traits:
Segment Traits | Friendbuy Standard Fields |
---|---|
userId |
id REQUIRED |
email |
email |
firstName |
first_name |
lastName |
last_name |
Here is a sample Javascript .identify()
call with the all the standard traits:
analytics.identify('2', {
firstName: 'Buzz'
lastName: 'Lightyear',
email: 'captain.lightyear@toystory.com',
});
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: 'captain.lightyear@toystory.com',
}, {
integrations: {
Friendbuy: {
stripeCustomerId: <email@stripe.com>,
chargebeeCustomerId: <email@chargebee.com>
}
}
});
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 Properties | Friendbuy Standard Fields |
---|---|
order_id |
id REQUIRED |
context.traits.email |
email |
revenue |
amount |
coupon |
coupon_code |
Then we will iterate over each item in your properties.products
and send the following mapping:
Segment Properties | Friendbuy Standard Fields |
---|---|
sku |
sku |
price |
price |
quantity |
quantity |
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
Before you start, make sure Friendbuy supports the source type and connection mode you’ve chosen to implement. You can learn more about connection modes here.
Web | Mobile | Server | |
---|---|---|---|
📱 Device-mode | ✅ | ⬜️ | ⬜️ |
☁️ Cloud-mode | ⬜️ | ⬜️ | ⬜️ |
Settings
Segment lets you change these destination settings from the Segment app without having to touch any code.
Page Widgets
Map your page calls to specific FriendBuy Widgets.
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.
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 following valid names for this integration:
-
FriendBuy
-
Friendbuy
This page was last modified: 02 Dec 2020
Need support?
Questions? Problems? Need more info? Contact us, and we can help!