Friendbuy Source

Friendbuy is a referral marketing platform that powers modern day word of mouth. Designed for growth marketers, Friendbuy allows companies to acquire new customers at scale through seamlessly integrated referral and influencer campaigns.

Adding Friendbuy as a Source to Segment is a surefire way to elevate analysis of your referral program performance. Friendbuy will automatically send referral events and important metadata to Segment.

These events can be passed to your Segment Destinations such as data warehouses and analytics tools. Joined with data from other marketing programs, you can start telling a unified story of each customer’s journey and tailor your reporting to the KPIs that matter most.

Getting Started

  1. From your Sources page in Segment (app.segment.com//sources), click Add source.
  2. Choose Friendbuy.
  3. Click Connect.
  4. Give the Source a nickname. The nickname will be used to designate the Source in the Segment interface.
  5. Copy the Segment write key for Friendbuy from the Overview page.
  6. Login to your Friendbuy account and enter this Segment write key at this location: Settings>Configurations>Integrations.
  7. Click Save.

Segment write key

  1. From your Segment account, click into your Friendbuy Source and you’ll be able to add other downstream Destinations where you want to see referral events.

You’re all set! Referral events such as shares, conversions, and reward evaluations will now be sent to Segment and any other destinations that you’ve enabled.

Customer Data

All referral events provided to Segment are in the context of specific customer (the advocate). Below are the customer attributes that Friendbuy provides to Segment along with these events. Wherever possible, customer data is mapped to Segment’s reserved properties as defined in the Segment Identify spec.

Trait NameDescription
idCustomer id assigned by the Merchant (Segment reserved property)
emailCustomer email address (Segment reserved property)
firstNameCustomer first name (Segment reserved property)
lastNameCustomer last name (Segment reserved property)
friendbuy_idInternal id of the customer record in Friendbuy
stripe_customer_idCustomer id of the advocate in Stripe
chargebee_customer_idCustomer id of the advocate in Chargebee

Referral Events

Below are the events that Friendbuy sends to Segment. These events will also appear in your Destinations, depending on which platforms you’ve enabled in Segment.

Event NameDescription
Referral SharedAn advocate shares with a friend through a Friendbuy referral widget (or REST API) to a channel such as email, Facebook, Messenger, Twitter, etc.
Referral ConvertedA referred friend signs up or orders through an advocate’s referral
Referral Reward EvaluatedA conversion is evaluated for fraud checks and criteria to determine if an advocate reward should be approved or rejected

Referral Shared

Below are the properties that are included in the Referral Shared event payload.

Property NameProperty Description
share_idFriendbuy internal id of the share
share_dateDate and time of the share
ip_addressIp_address of advocate at time of share
referral_codeFriendbuy internal identifier used to make attribution between friend order and advocate referral
messageAdvocate provided message to the friend
channelFriendbuy channel the share was issued from (email, facebook, facebook messenger, twitter)
recipientsArray of recipient email addresses for shares sent via email
variant_idFriendbuy internal id for the widget variant the share is associated with
variant_nameMerchant defined name for the widget variant
reward_typeMerchant defined Reward Type for the advocate reward
reward_amountMerchant defined Reward Amount for the advocate reward
newsletter_opt_inIndicates if an advocate opted in to receiving newsletter communications
reminder_opt_inIndicates if an advocate requested Friendbuy to send referred friend a reminder if they haven’t converted within 3 days

Referral Converted

Below are the properties that are included in the Referral Converted event payload. Wherever possible, referral conversion data is mapped to Segment’s reserved properties as defined in the Segment Ecommerce spec.

Property NameProperty Description
conversion_idFriendbuy internal id of the conversion
conversion_dateDate and time of the conversion
order_idOrder id of the order (Segment reserved property)
totalTotal amount of the order (Segment reserved property)
couponCoupon code used at checkout (Segment reserved property)
productsArray of products in the order
products.skuSku for a single product (Segment reserved property)
products.pricePrice of a single product (Segment reserved property)
products.quantityQuantity of a single product (Segment reserved property)
purchase_dateDate and time of the order was placed
friend_new_customerIndicator from the merchant that the order is associated to a new customer
friend_emailEmail address of the purchaser
flagged_self_referralIndicates a self referral based fraud checks enabled by the merchant
fraud_same browserResult of Friendbuy’s automatic comparison of referrals and orders made by the same browser and session
fraud_same_customer_idResult of Friendbuy’s automatic comparison of referrals and purchases with the same email addresses
fraud_normal_sensitivity_email_addressResult of Friendbuy’s automatic comparison of referrals and orders with a similar email address based on a basic algorithm that uses case normalization and strips domain
fraud_high_sensitivity_email_addressResult of Friendbuy’s automatic comparison of referrals and orders with a similar email address based on a advanced algorithm with an adjustable threshold
fraud_same_ip_addressResult of Friendbuy’s automatic comparison of referrals and orders made with the same IP addresses
fraud_same_ip_and_user_agentResult of Friendbuy’s automatic comparison of referrals and orders with made with the same IP addresses and same user agent
share_idFriendbuy internal id of the share (NULL if channel is PURL)
referral_codeFriendbuy internal identifier used to make attribution between friend order and advocate referral
channelFriendbuy channel the share was issued from (email, facebook, facebook messenger, twitter)
variant_idFriendbuy internal id for the widget variant the share is associated with
variant_nameMerchant defined name for the widget variant
reward_typeMerchant defined Reward Type for the advocate reward
reward_amountMerchant defined Reward Amount for the advocate reward

Referral Reward Evaluated

Below are the properties that are included in the Referral Reward Evaluated event payload.

Property NameProperty Description
idFriendbuy internal id of the reward
reward_dateDate and time the pending reward record was created
evaluated_dateDate and time the reward was evaluated and set to rejected or approved
statusStatus of the reward, either rejected or approved
rejected_reasonsReason(s) why a reward was rejected based on fraud and reward criteria evaluation
share_idFriendbuy internal id of the share
conversion_idFriendbuy internal id of the conversion
referral_codeFriendbuy internal identifier used to make attribution between friend order and advocate referral
channelFriendbuy channel the share was issued from (email, facebook, facebook messenger, twitter)
variant_idFriendbuy internal id for the widget variant the share is associated with
variant_nameMerchant defined name for the widget variant
reward_typeMerchant defined Reward Type for the advocate reward
reward_amountMerchant defined Reward Amount for the advocate reward

Prerequisites for Source Integration

In order to take advantage of this Source destination, you must be sending Friendbuy customer data either through their ‘track’,’order’ JavaScript integration or by POSTing shares and orders to the REST API.

Send Data to Friendbuy

The Friendbuy Source works better when you also connect Friendbuy as a downstream destination within Segment. With the Friendbuy Destination, you can use Segment’s snippets to load Friendbuy’s JavaScript integration used to power loading widgets and tracking of customers, orders, and products. Check out the Friendbuy Destination documentation to get started.


If you have any questions, or see anywhere we can improve our documentation, please let us know!