Skip to content

Commit b0d8310

Browse files
authored
Merge pull request #46 from segmentio/repo-sync
repo sync
2 parents 798152f + cfadd3b commit b0d8310

File tree

9 files changed

+109
-43
lines changed

9 files changed

+109
-43
lines changed

.github/release.yml

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ changelog:
33
labels:
44
- automated-reposync-pr
55
- autoupdate
6+
- back-end
67
authors:
78
- bot-docsteam
89
categories:
@@ -18,6 +19,7 @@ changelog:
1819
- title: Fixes
1920
labels:
2021
- fixed-content
22+
- fixed-site
2123
- title: Other Updates
2224
labels:
2325
- "*"

js/algolia/index.js

+15-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const placeHolder = envApiKey != null ? 'Search the Segment documentation' : 'Se
1818
const searchClient = algoliasearch(appId, apiKey);
1919

2020
//insights
21-
insightsClient('init', { appId, apiKey });
21+
insightsClient('init', { appId, apiKey, useCookie: true });
2222
const algoliaInsightsPlugin = createAlgoliaInsightsPlugin({ insightsClient });
2323

2424
// define locations to separate invocation for mobile and desktop
@@ -39,9 +39,9 @@ function initAutocomplete(item){
3939
sourceId: 'articles',
4040
getItemUrl({ item }){
4141
if (item.anchor != null) {
42-
var itemUrl = item.url+"#" + item.anchor;
42+
var itemUrl = '/docs'+item.url+"#" + item.anchor;
4343
} else {
44-
var itemUrl = item.url;
44+
var itemUrl = '/docs'+item.url;
4545
}
4646
return itemUrl;
4747
},
@@ -87,9 +87,19 @@ function initAutocomplete(item){
8787
},
8888
navigator: {
8989
navigate({ itemUrl }) {
90-
window.location.assign('/docs'+itemUrl);
90+
window.location.assign(itemUrl);
9191
},
92-
}
92+
navigateNewTab({ itemUrl }) {
93+
const windowReference = window.open(itemUrl, '_blank', 'noopener');
94+
95+
if (windowReference) {
96+
windowReference.focus();
97+
}
98+
},
99+
navigateNewWindow({ itemUrl }) {
100+
window.open(itemUrl, '_blank', 'noopener');
101+
},
102+
},
93103
});
94104

95105
}

src/_data/catalog/overrides-list.yml

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ items:
33
- iterable
44
- google-ads-gtag
55
- klaviyo
6+
- friendbuy

src/_data/catalog/overrides.yml

+47
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,50 @@ items:
6060
accepts data in cloud-mode from web and mobile sources, and can accept data in device-mode from Analytics.js sources.
6161
cmode_type: mixed
6262
case: '10'
63+
- slug: friendbuy
64+
display_name: Friendbuy
65+
previous_names:
66+
- FriendBuy
67+
components:
68+
- code: https://github.com/segment-integrations/analytics.js-integration-friendbuy
69+
type: browser
70+
connection_modes:
71+
device:
72+
web: true
73+
mobile: false
74+
server: false
75+
cloud:
76+
web: false
77+
mobile: false
78+
server: false
79+
summary: accepts device-mode data only from Analytics.js.
80+
cmode_type: device-only
81+
case: '2'
82+
settings:
83+
- name: siteId
84+
type: string
85+
defaultValue: ''
86+
description: >-
87+
This is your **Site ID**. It is used to identify your account in our
88+
platform so we can properly attribute referral data. You can find your
89+
Site ID in the in Friendbuy web application at **Settings > Integration
90+
Code**
91+
required: true
92+
label: Site ID
93+
- name: siteWideWidgets
94+
type: mixed
95+
defaultValue: []
96+
description: >-
97+
By default, Friendbuy recommends you add a site wide overlay widget. You
98+
can enter any of these site wide widgets here and we will load them any
99+
time we receive a `.page()` call. *Note*: If you have custom widgets
100+
mapped to named pages in the *Widgets* setting and you have provided a
101+
site wide widget, we will load both.
102+
required: false
103+
label: Site Wide Widgets
104+
- name: widgets
105+
type: mixed
106+
defaultValue: []
107+
description: Map your page calls to specific FriendBuy Widgets.
108+
required: false
109+
label: Page Widgets

src/_includes/content/destination-dossier.html

+5-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
{% endfor %}
1616
{% assign destMethods = destMethods| reverse %}
1717

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

2932
{% unless destinationInfo.connection_modes.case == "0"%}
30-
{% if page.cmode-override %}
31-
{% assign destinationInfo = site.data.catalog.overrides.items % | where: "slug", thisDestination | first %}
32-
{% endif %}
33+
3334
<p>
3435
{{ 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.
36+
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;.
3537
{% endif %}
3638
</p>
3739
{% endunless %}

src/_includes/content/destination-footer.md

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ When you first create an audience, Personas sends an Identify call for every use
4444

4545
{% unless page.hide-settings == true %}
4646
## Settings
47-
4847
Segment lets you change these destination settings from the Segment app without having to touch any code.
4948
<table class="settings">
5049
<thead>
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
---
22
title: Friendbuy Destination
3+
cmode-override: true
34
---
5+
Friendbuy is a referral marketing and campaign optimization platform.
46

57
## Getting Started
68

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

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

1618
This destination allows you to:
1719

18-
- Map your Page calls to facilitate [Widget Management](http://developers.friendbuy.com/#widget-management)
19-
- Map your Identify calls to facilitate [Customer Tracking](http://developers.friendbuy.com/#customer-tracking)
20-
- Map your Track calls to facilitate [Order Tracking](http://developers.friendbuy.com/#order-tracking) and [Product Tracking](http://developers.friendbuy.com/#product-tracking)
20+
- Map your Page calls to enable [Widget Management](http://developers.friendbuy.com/#widget-management)
21+
- Map your Identify calls to enable [Customer Tracking](http://developers.friendbuy.com/#customer-tracking)
22+
- Map your Track calls to enable [Order Tracking](http://developers.friendbuy.com/#order-tracking) and [Product Tracking](http://developers.friendbuy.com/#product-tracking)
23+
2124

22-
----------
2325
## Page
2426

2527
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**.
2628

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

30-
![](images/23163f90cfc1f375f6c0da3a06060da4.gif)-->
30+
Friendbuy has two Widgets you can map to your Page calls:
31+
32+
**Site Wide Widgets**
33+
34+
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.
3135

32-
There are two types of Widgets you can map to your Page calls:
36+
> info ""
37+
> 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.
3338
34-
- Site Wide Widgets
35-
- 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.
39+
**Other widgets**
3640

37-
- Other widgets
38-
 - All other widgets will fall under this category whereby you can map the `name` of a unique Segment `.page()` call to a widget ID.
41+
All other widgets will fall under this category whereby you can map the `name` of a unique Segment `.page()` call to a widget ID.
3942

40-
_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.
43+
> info ""
44+
> If you have mapped a site wide overlay widget, it loads on every `.page()` call.
4145
42-
----------
4346
## Identify
4447

45-
When you call `.identify()`, we will send the following mapped traits:
48+
When you call `.identify()`, Segment sends the following mapped traits:
4649

4750
| **Segment Traits** | **Friendbuy Standard Fields** |
4851
| --------------------- | ----------------------------- |
@@ -61,11 +64,11 @@ analytics.identify('2', {
6164
});
6265
```
6366

64-
**NOTE**: Friendbuy does not accept any custom traits.
65-
67+
> info ""
68+
> Friendbuy does not accept custom traits.
6669
### Stripe and Chargebee Customer ID
6770

68-
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:
71+
If you integrate with Stripe or Chargebee and need send those IDs to Friendbuy, you can pass them as integration specific options:
6972

7073
```js
7174
analytics.identify('2', {
@@ -74,7 +77,7 @@ analytics.identify('2', {
7477
7578
}, {
7679
integrations: {
77-
Friendbuy: {
80+
FriendBuy: {
7881
stripeCustomerId: <email@stripe.com>,
7982
chargebeeCustomerId: <email@chargebee.com>
8083
}
@@ -84,11 +87,11 @@ analytics.identify('2', {
8487

8588
## Track / Order Completed
8689

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

8992
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.
9093

91-
When sending the order details, we will make the following translation:
94+
When you send order details, Segment makes the following translation:
9295

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

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

102105

103106
| **Segment Properties** | **Friendbuy Standard Fields** |
@@ -106,12 +109,12 @@ Then we will iterate over each item in your `properties.products` and send the f
106109
| `price` | `price` |
107110
| `quantity` | `quantity` |
108111

109-
**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:
110-
111-
```js
112-
integrations: {
113-
Friendbuy: {
114-
newCustomer: true,
115-
}
116-
}
117-
```
112+
> info ""
113+
> You can optionally specify if the customer who made the order is a new customer by passing `new_customer` under your integration specific options:
114+
> ```js
115+
> integrations: {
116+
> FriendBuy: {
117+
> newCustomer: true,
118+
> }
119+
> }
120+
>```

src/connections/sources/catalog/libraries/website/javascript/custom-proxy.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ You need the "Domain Name" for the next step, so keep this browser window open.
120120

121121
#### Add CNAME Record to DNS
122122

123-
Next, add a CNAME record to your DNS settings. Go to your domain registrar and add a new record to your DNS of type "CNAME".
123+
Next, add a CNAME record for the Segment proxy to your organizations DNS settings. Use a name that makes it clear what you are using the subdomain for, for example `analytics.mysite.com`. Go to your domain registrar and add a new record to your DNS of type "CNAME".
124124

125125
<table>
126126
<tr>

vale-styles/Vocab/Docs/accept.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,6 @@ gmail
5252
(?:U|u)nlinks?\b
5353
(?:P|p)ostgres
5454
Smartly
55-
Hubspot
55+
Hubspot
56+
Friendbuy
57+
Chargebee

0 commit comments

Comments
 (0)