Skip to content

DOC-332 added overrides for Friendbuy #1969

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/_data/catalog/overrides-list.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ items:
- iterable
- google-ads-gtag
- klaviyo
- friendbuy
47 changes: 47 additions & 0 deletions src/_data/catalog/overrides.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,50 @@ items:
accepts data in cloud-mode from web and mobile sources, and can accept data in device-mode from Analytics.js sources.
cmode_type: mixed
case: '10'
- slug: friendbuy
display_name: Friendbuy
previous_names:
- FriendBuy
components:
- code: https://github.com/segment-integrations/analytics.js-integration-friendbuy
type: browser
connection_modes:
device:
web: true
mobile: false
server: false
cloud:
web: false
mobile: false
server: false
summary: accepts device-mode data only from Analytics.js.
cmode_type: device-only
case: '2'
settings:
- name: siteId
type: string
defaultValue: ''
description: >-
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**
required: true
label: Site ID
- name: siteWideWidgets
type: mixed
defaultValue: []
description: >-
By default, Friendbuy recommends you add a site wide overlay widget. You
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
By default, Friendbuy recommends you add a site wide overlay widget. You
By default, Friendbuy recommends that you add a site wide overlay widget. You

This is minor, but I'd explicitly write out the relative pronoun here. It helps with users who put our pages through online translators.

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think when it's used as an adjective, site-wide requires a hyphen.

required: false
label: Site Wide Widgets
- name: widgets
type: mixed
defaultValue: []
description: Map your page calls to specific FriendBuy Widgets.
required: false
label: Page Widgets
8 changes: 5 additions & 3 deletions src/_includes/content/destination-dossier.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
{% endfor %}
{% assign destMethods = destMethods| reverse %}

{% if page.cmode-override %}
{% assign destinationInfo = site.data.catalog.overrides.items % | where: "slug", thisDestination | first %}
{% endif %}
<div class="quick-info">
<h4>{{ destinationInfo.display_name }} quick info </h4>
<p>{% if destMethods.size > 0 %}
Expand All @@ -27,11 +30,10 @@ <h4>{{ destinationInfo.display_name }} quick info </h4>
{% if destinationInfo.replay %} {{ destinationInfo.display_name }} is eligible for <a href="/docs/guides/what-is-replay/">Replay</a>. {% endif %}</p>

{% unless destinationInfo.connection_modes.case == "0"%}
{% if page.cmode-override %}
{% assign destinationInfo = site.data.catalog.overrides.items % | where: "slug", thisDestination | first %}
{% endif %}

<p>
{{ destinationInfo.display_name }} {{ destinationInfo.connection_modes.summary }} {% if destinationInfo.connection_modes.case == "mixed" %} {{destinationInfo.display_name}} accepts device-mode data from {% if destinationInfo.connection_modes.device.mobile and destinationInfo.connection_modes.device.web %} mobile and web{% elsif destinationInfo.connection_modes.device.mobile %} mobile{% elsif destinationInfo.connection_modes.device.web %} web{% endif %} sources.{% endif %} {% if destinationInfo.browserUnbundlingSupported %} You can change the {{destinationInfo.display_name}} connection mode for Analytics.js sources from the destination settings in the Segment web app.
If you reference it in the <a href="/docs/guides/filtering-data/#filtering-with-the-integrations-object">Integrations object</a>, call it &ldquo;{{destinationInfo.previous_names | join: '", or "' }}&rdquo;.
{% endif %}
</p>
{% endunless %}
Expand Down
1 change: 0 additions & 1 deletion src/_includes/content/destination-footer.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ When you first create an audience, Personas sends an Identify call for every use

{% unless page.hide-settings == true %}
## Settings

Segment lets you change these destination settings from the Segment app without having to touch any code.
<table class="settings">
<thead>
Expand Down
67 changes: 35 additions & 32 deletions src/connections/destinations/catalog/friendbuy/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
title: Friendbuy Destination
cmode-override: true
---
Friendbuy is a referral marketing and campaign optimization platform.

## Getting Started

Setting up Friendbuy is very simple!
{% include content/connection-modes.md %}

1. Log in to your Friendbuy account and go to **Integration Code**.
2. Copy the **Site ID** above the snippet box.
Expand All @@ -15,34 +17,35 @@ Setting up Friendbuy is very simple!

This destination allows you to:

- Map your Page calls to facilitate [Widget Management](http://developers.friendbuy.com/#widget-management)
- Map your Identify calls to facilitate [Customer Tracking](http://developers.friendbuy.com/#customer-tracking)
- Map your Track calls to facilitate [Order Tracking](http://developers.friendbuy.com/#order-tracking) and [Product Tracking](http://developers.friendbuy.com/#product-tracking)
- Map your Page calls to enable [Widget Management](http://developers.friendbuy.com/#widget-management)
- Map your Identify calls to enable [Customer Tracking](http://developers.friendbuy.com/#customer-tracking)
- Map your Track calls to enable [Order Tracking](http://developers.friendbuy.com/#order-tracking) and [Product Tracking](http://developers.friendbuy.com/#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](http://developers.friendbuy.com/#widget-options) such as **auto delay** and **custom parameters**.

<!-- TODO: convert this long gif into text instrucitons.
See the following gif for example:

![](images/23163f90cfc1f375f6c0da3a06060da4.gif)-->
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.

There are two types of Widgets you can map to your Page calls:
> 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.

- 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**

- 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.
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.
> info ""
> If you have mapped a site wide overlay widget, it loads on every `.page()` call.

----------
## Identify

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

| **Segment Traits** | **Friendbuy Standard Fields** |
| --------------------- | ----------------------------- |
Expand All @@ -61,11 +64,11 @@ analytics.identify('2', {
});
```

**NOTE**: Friendbuy does not accept any custom traits.

> info ""
> Friendbuy does not accept 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:
If you integrate with Stripe or Chargebee and need send those IDs to Friendbuy, you can pass them as integration specific options:

```js
analytics.identify('2', {
Expand All @@ -74,7 +77,7 @@ analytics.identify('2', {
email: '[email protected]',
}, {
integrations: {
Friendbuy: {
FriendBuy: {
stripeCustomerId: <[email protected]>,
chargebeeCustomerId: <[email protected]>
}
Expand All @@ -84,11 +87,11 @@ analytics.identify('2', {

## Track / Order Completed

This Destination accepts only `Order Completed` events as decribed in our [ecommerce spec](https://segment.com/docs/connections/spec/ecommerce/v2/#order-completed).
This Destination accepts `Order Completed` events as described in the Segment [ecommerce spec](/docs/connections/spec/ecommerce/v2/#order-completed).

Friendbuy has a concept of [Order Tracking](http://developers.friendbuy.com/#order-tracking) and [Product Tracking](http://developers.friendbuy.com/#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:
When you send order details, Segment makes the following translation:

| **Segment Properties** | **Friendbuy Standard Fields** |
| ------------------------- | ----------------------------- |
Expand All @@ -97,7 +100,7 @@ When sending the order details, we will make the following translation:
| `revenue` | `amount` |
| `coupon` | `coupon_code` |

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


| **Segment Properties** | **Friendbuy Standard Fields** |
Expand All @@ -106,12 +109,12 @@ Then we will iterate over each item in your `properties.products` and send the f
| `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:

```js
integrations: {
Friendbuy: {
newCustomer: true,
}
}
```
> 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:
> ```js
> integrations: {
> FriendBuy: {
> newCustomer: true,
> }
> }
>```
4 changes: 3 additions & 1 deletion vale-styles/Vocab/Docs/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,6 @@ gmail
(?:U|u)nlinks?\b
(?:P|p)ostgres
Smartly
Hubspot
Hubspot
Friendbuy
Chargebee