Skip to content

Commit c58a5f7

Browse files
committed
Merge branch 'develop' into dummy-form-test
2 parents e4018f3 + 81816fb commit c58a5f7

File tree

17 files changed

+215
-45
lines changed

17 files changed

+215
-45
lines changed

scripts/private-destination.js

Lines changed: 59 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ require('dotenv').config();
1717
const PAPI_URL = "https://api.segmentapis.com"
1818

1919
const PRIVATE_DESTINATIONS = yaml.load(fs.readFileSync(path.resolve(__dirname, `../src/_data/catalog/destinations_private.yml`)))
20+
const slugOverrides = yaml.load(fs.readFileSync(path.resolve(__dirname, `../src/_data/catalog/slugs.yml`)))
21+
2022
const privateDests = PRIVATE_DESTINATIONS.items
2123
let private = []
2224
const getCatalog = async (url, page_token = "MA==") => {
@@ -37,25 +39,65 @@ const getCatalog = async (url, page_token = "MA==") => {
3739
return res.data
3840
} catch (err) {
3941
console.error("Error response:");
40-
console.error(err.response.data); // ***
41-
console.error(err.response.status); // ***
42+
console.error(err.response.data); // ***
43+
console.error(err.response.status); // ***
4244
console.error(err.response.headers); // ***
4345
} finally {
44-
46+
4547
}
4648
}
4749

50+
const slugify = (displayName) => {
51+
let slug = displayName
52+
.toLowerCase()
53+
.replace(/\s+/g, '-')
54+
.replace('-&-', '-')
55+
.replace('/', '-')
56+
.replace(/[\(\)]/g, '')
57+
.replace('.', '-')
58+
59+
for (key in slugOverrides) {
60+
let original = slugOverrides[key].original
61+
let override = slugOverrides[key].override
62+
63+
if (slug == original) {
64+
slug = override
65+
}
66+
}
67+
68+
return slug
69+
}
4870

4971
const checkDestinationStatus = async (id) => {
5072
const res = await getCatalog(`${PAPI_URL}/catalog/destinations/${id}`)
5173
let destination = res.data.destinationMetadata
5274
return destination
5375
}
76+
77+
const makeDestinationPublic = async (itemURL) => {
78+
const catalogPath = path.resolve('src/', itemURL, 'index.md')
79+
const f = fm(fs.readFileSync(catalogPath, 'utf8'));
80+
const fmatter = f.attributes
81+
fmatter.private = false
82+
fmatter.hidden = false
83+
let new_fm = ""
84+
for (const property in fmatter) {
85+
if (property == "versions") {
86+
console.log(`Need to fix versions on this one`)
87+
}
88+
//console.log(`${property}: ${fmatter[property]}`);
89+
new_fm += `${property}: ${fmatter[property]}\n`
90+
}
91+
const attr = `---\n${new_fm}\n---\n`
92+
const body = f.body
93+
const content = attr + body
94+
fs.writeFileSync(catalogPath, content)
95+
}
5496
const getDestinationData = async (id) => {
5597
const res = await getCatalog(`${PAPI_URL}/catalog/destinations/${id}`)
5698
if (res == null) {
5799
return
58-
}
100+
}
59101
let destination = res.data.destinationMetadata
60102
let settings = destination.options
61103
settings.sort((a, b) => {
@@ -69,11 +111,13 @@ const getDestinationData = async (id) => {
69111
})
70112
let actions = destination.actions
71113
let presets = destination.presets
114+
let slug = slugify(destination.name)
115+
let url = `connections/destinations/catalog/${slug}`
72116

73117
// Force screen method into supportedMethods object
74118
destination.supportedMethods.screen = false
75119
// Set it true for LiveLike, per request
76-
if (destination.id == '63e42b47479274407b671071'){
120+
if (destination.id == '63e42b47479274407b671071') {
77121
destination.supportedMethods.screen = true
78122
}
79123

@@ -93,8 +137,9 @@ const getDestinationData = async (id) => {
93137
id: destination.id,
94138
display_name: destination.name,
95139
name: destination.name,
96-
slug: destination.slug,
140+
slug: slugify(destination.name),
97141
previous_names: destination.previousNames,
142+
url,
98143
website: destination.website,
99144
status: destination.status,
100145
logo: {
@@ -119,6 +164,7 @@ const getDestinationData = async (id) => {
119164
private.push(updatePrivateDest)
120165
} else {
121166
console.log(`${destination.name} is public and will be removed`)
167+
makeDestinationPublic(url)
122168
}
123169

124170
const options = {
@@ -148,12 +194,18 @@ const checkExistingStatus = async () => {
148194
let id = existingIds[i]
149195
let destination = await checkDestinationStatus(id)
150196
let status = destination.status
197+
let slug = slugify(destination.name)
198+
let url = `connections/destinations/catalog/${slug}`
199+
200+
201+
151202

152203
if (status === "PRIVATE_BETA") {
153204
// console.log(`${destination.name} is private`)
154205
newIds.push(id)
155206
} else {
156-
// console.log(`${destination.name}is public`)
207+
console.log(`src/connections/${destination.name}is public`)
208+
makeDestinationPublic(url)
157209
}
158210
}
159211
return newIds

src/_data/catalog/destinations_private.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# AUTOGENERATED FROM PUBLIC API. DO NOT EDIT
2-
# destination data last updated 2023-03-30
2+
# destination data last updated 2023-03-31
33
items:
44
- id: 54521fd725e721e32a72eec1
55
display_name: HubSpot
66
name: HubSpot
77
slug: hubspot
88
previous_names:
99
- HubSpot
10+
url: connections/destinations/catalog/hubspot
1011
website: http://www.hubspot.com
1112
status: PRIVATE_BETA
1213
logo:
@@ -123,6 +124,7 @@ items:
123124
slug: intercom
124125
previous_names:
125126
- Intercom
127+
url: connections/destinations/catalog/intercom
126128
website: http://intercom.com
127129
status: PRIVATE_BETA
128130
logo:
@@ -231,6 +233,7 @@ items:
231233
slug: pardot
232234
previous_names:
233235
- Pardot
236+
url: connections/destinations/catalog/pardot
234237
website: http://pardot.com
235238
status: PRIVATE_BETA
236239
logo:
@@ -342,6 +345,7 @@ items:
342345
slug: salesforce
343346
previous_names:
344347
- Salesforce
348+
url: connections/destinations/catalog/salesforce
345349
website: http://salesforce.com
346350
status: PRIVATE_BETA
347351
logo:
@@ -472,6 +476,7 @@ items:
472476
slug: webhooks
473477
previous_names:
474478
- Webhooks
479+
url: connections/destinations/catalog/webhooks
475480
website: https://segment.com/docs/integrations/webhooks
476481
status: PRIVATE_BETA
477482
logo:
@@ -531,9 +536,10 @@ items:
531536
- id: 62b256147cbb49302d1486d0
532537
display_name: Heap Web (Actions)
533538
name: Heap Web (Actions)
534-
slug: actions-heap-web
539+
slug: actions-heap
535540
previous_names:
536541
- Heap Web (Actions)
542+
url: connections/destinations/catalog/actions-heap
537543
website: https://heap.io/
538544
status: PRIVATE_BETA
539545
logo:
@@ -735,6 +741,7 @@ items:
735741
slug: actions-iterate
736742
previous_names:
737743
- Iterate Web (Actions)
744+
url: connections/destinations/catalog/actions-iterate
738745
website: http://www.segment.com
739746
status: PRIVATE_BETA
740747
logo:
@@ -846,6 +853,7 @@ items:
846853
slug: actions-sabil
847854
previous_names:
848855
- Sabil
856+
url: connections/destinations/catalog/actions-sabil
849857
website: https://sabil.io
850858
status: PRIVATE_BETA
851859
logo:
@@ -923,6 +931,7 @@ items:
923931
slug: actions-saleswings
924932
previous_names:
925933
- Saleswings (Actions)
934+
url: connections/destinations/catalog/actions-saleswings
926935
website: >-
927936
https://www.saleswingsapp.com/lead-scoring-segment-com/?utm_campaign=segmentcatalogue&utm_medium=partnerlisting&utm_source=segment
928937
status: PRIVATE_BETA
@@ -1805,6 +1814,7 @@ items:
18051814
slug: actions-livelike-cloud
18061815
previous_names:
18071816
- LiveLike
1817+
url: connections/destinations/catalog/actions-livelike-cloud
18081818
website: https://livelike.com/
18091819
status: PRIVATE_BETA
18101820
logo:
@@ -2050,6 +2060,7 @@ items:
20502060
slug: actions-emarsys
20512061
previous_names:
20522062
- Emarsys (Actions)
2063+
url: connections/destinations/catalog/actions-emarsys
20532064
website: http://www.emarsys.com
20542065
status: PRIVATE_BETA
20552066
logo:
@@ -2350,9 +2361,10 @@ items:
23502361
- id: 63ff8bae963d5cb4fc79f097
23512362
display_name: Outfunnel
23522363
name: Outfunnel
2353-
slug: outfunnel
2364+
slug: actions-outfunnel
23542365
previous_names:
23552366
- Outfunnel
2367+
url: connections/destinations/catalog/actions-outfunnel
23562368
website: https://outfunnel.com/product-led-sales-platform/
23572369
status: PRIVATE_BETA
23582370
logo:
@@ -2822,6 +2834,7 @@ items:
28222834
slug: actions-toplyne-cloud
28232835
previous_names:
28242836
- Toplyne Cloud Mode (Actions)
2837+
url: connections/destinations/catalog/actions-toplyne-cloud
28252838
website: http://www.segment.com
28262839
status: PRIVATE_BETA
28272840
logo:

src/_data/catalog/slugs.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,20 @@
8383
- original: "qualtrics"
8484
override: "actions-qualtrics"
8585
- original: "tiktok-audiences"
86-
override: "actions-tiktok-audiences"
86+
override: "actions-tiktok-audiences"
87+
- original: "heap-web-actions"
88+
override: "actions-heap"
89+
- original: "iterate-web-actions"
90+
override: "actions-iterate"
91+
- original: "sabil"
92+
override: "actions-sabil"
93+
- original: "saleswings-actions"
94+
override: "actions-saleswings"
95+
- original: "livelike"
96+
override: "actions-livelike-cloud"
97+
- original: "emarsys-actions"
98+
override: "actions-emarsys"
99+
- original: "outfunnel"
100+
override: "actions-outfunnel"
101+
- original: "toplyne-cloud-mode-actions"
102+
override: "actions-toplyne-cloud"

src/_data/products.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ items:
138138
business: true
139139
add-on: true
140140
- product_display_name: Regional Segment
141-
slug: data-residency
141+
slug: regional
142142
plan-note: "Regional Segment is available to customers on the Business Tier plan."
143143
plans:
144144
free: false

src/_includes/content/plan-grid.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@
4848
{% else %}
4949
<p style="font-size:12px">{{productData.product_display_name}} is available for the listed account plans only.
5050
{% endif %}
51-
<br>See the <a href="https://segment.com/pricing">available plans</a>, or <a href="https://segment.com/help/contact/">contact us</a>.</p></div>
51+
<br>See the <a href="https://segment.com/pricing">available plans</a>, or <a href="https://segment.com/help/contact/">contact Support</a>.</p></div>
5252
</div>
5353
{% endif %}

src/connections/destinations/catalog/actions-google-analytics-4-web/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,10 @@ Google may take [24-48 hours](https://support.google.com/analytics/answer/933379
6161
### Data is not sent to Google
6262

6363
Ensure that at least one mapping has been configured and enabled in the destination mappings for an event you want to send to Google Analytics. If no mappings are enabled, the destination does not send events.
64+
65+
### Page Views
66+
67+
The **Page Views** advanced setting prevents sending the `page_view` included in the gtag.js snippet, not Segment's `analytics.page()` event available in the Analytics.js snippet by default. If you enable this setting, once the page loads, two `page_view` events will still send to the GA4 SDK, one from the Segment snippet and one from the gtag.js snippet. If you see duplicate `page_view` events in your GA4 dashboard, you need to either:
68+
69+
1. Disable the **Page Views** advanced setting (set it to *False*) so only Segment's `analytics.page()` sends to the GA4 SDK. Or,
70+
2. Edit or disable the preset **Set Configuration Fields** mapping so only the `page_view` included in the gtag.js snippet sends to the GA4 SDK.

src/connections/destinations/catalog/actions-salesforce/index.md

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Segment’s Salesforce (Actions) destination allows you to create, update or ups
2020
The Salesforce (Actions) destination provides the following benefits over the classic Salesforce destination:
2121
- **Fewer settings**. Data mapping for actions-based destinations happens during configuration, which eliminates the need for most settings.
2222
- **Clearer mapping of data**. Actions-based destinations enable you to define the mapping between the data Segment receives from your source, and the data Segment sends to Salesforce.
23-
- **OAuth 2.0 support**. Authentication with Salesforce leverages OAuth 2.0 instead of a username/password.
23+
- **OAuth 2.0 support**. Authentication with Salesforce uses OAuth 2.0 instead of a username/password.
2424
- **Flexible match keys**. Upsert and update records based on any match key, including external IDs, record IDs, email and other object fields.
2525
- **Batch support**. Reduce Salesforce overages and rate-limit errors by batching your Segment data to Salesforce's Bulk API 2.0.
2626

@@ -60,10 +60,58 @@ When using the `update` and `upsert` operations, you must specify the match key(
6060

6161
If multiple fields are provided in the Record Matchers object, Segment uses an "OR" operator to query Salesforce for a record. If multiple records are returned upon query, no updates will be made. Segment will instead record a 300 error status for the request, and the request will not be retried. **Please use fields that result in unique records**.
6262

63-
Please note Salesforce only allows querying on fields that have the "Filter" property. For example, we cannot query on the Case `Description` because it is not a filterable property. You can lookup the standard field properties in [Salesforce’s API documentation](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_rest.htm){:target="_blank"} to determine if a field is available for querying.
63+
Please note Salesforce only allows querying on fields that have the "Filter" property. For example, Segment doesn't query on the Case `Description` because it is not a filterable property. You can lookup the standard field properties in [Salesforce’s API documentation](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_rest.htm){:target="_blank"} to determine if a field is available for querying.
6464

6565
![the filter property](images/image1.png)
6666

67+
## Migrate from Salesforce (Classic)
68+
69+
To migrate from Salesforce (Classic), complete the following steps before May 31, 2023:
70+
71+
1. Log in to your Segment workspace and review the copied settings in each new Salesforce (Actions) instance to ensure their accuracy.
72+
2. Authenticate Segment with Salesforce with OAuth.
73+
3. Enable the Salesforce (Actions) destination & disable the Classic destination.
74+
75+
> info "Authenticate with Salesforce"
76+
> Salesforce (Actions) requires OAuth based authentication while Salesforce Classic uses tokens and credentials. Because of this, Segment can't migrate authentication credentials. Your workspace owner must login and configure OAuth Authentication for each Salesforce (Actions) destinations that were migrated.
77+
78+
If you have more than one Salesforce instance connected to Segment, repeat these three steps for each instance.
79+
80+
Keep the following in mind as you begin to use Salesforce (Actions):
81+
- Salesforce (Actions) supports batching. The workspace owner can edit the enabled-batching field manually for any of the mappings. This setting is disabled by default.
82+
- Salesforce (Actions) doesn’t support Delete CRUD operations on Custom Object. Custom Objects with CRUD the operation set to `delete` are not migrated.
83+
- Sending Identify events to Salesforce (Classic) results in a create or update operation for Leads, and maps properties from `event.traits` Salesforce (Actions) does not support this behavior. By default, the migration tool maps only a subset of the most used Lead properties as mentioned below. The workspace owner must map any additional Salesforce properties or Custom properties manually.
84+
85+
Review the tables below to see how settings from Salesforce (Classic) were migrated to Salesforce (Actions).
86+
87+
### Leads
88+
89+
| Salesforce (Actions) property | Migrated behavior |
90+
| ----------------------------- | ------------------------------------------------------------------------------------------------------------- |
91+
| Record Matchers | Uses **Custom Lead Lookup** fields from Salesforce (Classic), if available, or **Email** as a fallback value. |
92+
| Name | Appears within the **Other Fields** property, defaults to `traits.name`. |
93+
| Phone | Appears within the **Other Fields** property, defaults to `coalesce(traits.phone, traits.phoneNumber)`. |
94+
| Title | Appears within the **Other Fields** property, defaults to `coalesce(traits.address.title, traits.position)`. |
95+
| Website | Appears within the **Other Fields** property, defaults to `traits.website`. |
96+
| Description | Appears within the **Other Fields** property, defaults to `traits.description`. |
97+
| Lead Source | Appears within the **Other Fields** property, defaults to `traits.leadSource`. |
98+
99+
### Account
100+
101+
| Salesforce (Actions) property | Migrated behavior |
102+
| ----------------------------- | ------------------------------------------------------------------------------------------------------------- |
103+
| Billing Street | Created only if the **Send Address as Billing Address** property is set in Salesforce (Classic). Defaults to `coalesce(traits.address.street, traits.street)`. |
104+
| Billing City | Created only if the **Send Address as Billing Address** property is set in Salesforce (Classic). Defaults to `coalesce(traits.address.city, traits.city)`. |
105+
| Billing State | Created only if the **Send Address as Billing Address** property is set in Salesforce (Classic). Defaults to `coalesce(traits.address.state, traits.state)`. |
106+
| Billing Country | Created only if the **Send Address as Billing Address** property is set in Salesforce (Classic). Defaults to `coalesce(traits.address.country, traits.country)`. |
107+
| Billing Postal Code | Created only if the **Send Address as Billing Address** property is set in Salesforce (Classic). Defaults to `coalesce(traits.address.postalCode, traits.postalCode)`. |
108+
| Shipping Street | Created only if the **Send Address as Shipping Address** property is set in Salesforce (Classic). Defaults to `coalesce(traits.address.street, traits.street)`. |
109+
| Shipping City | Created only if the **Send Address as Shipping Address** property is set in Salesforce (Classic). Defaults to `coalesce(traits.address.city, traits.city)`. |
110+
| Shipping State | Created only if the **Send Address as Shipping Address** property is set in Salesforce (Classic). Defaults to `coalesce(traits.address.state, traits.state)`. |
111+
| Shipping Country | Created only if the **Send Address as Shipping Address** property is set in Salesforce (Classic). Defaults to `coalesce(traits.address.country, traits.country)`. |
112+
| Shipping Postal Code | Created only if the **Send Address as Shipping Address** property is set in Salesforce (Classic). Defaults to `coalesce(traits.address.postalCode, traits.postalCode)`. |
113+
114+
67115
## FAQ
68116

69117
### How do I enable a sandbox instance?
@@ -72,7 +120,7 @@ To send data to a Salesforce sandbox instance, navigate to **Settings > Advanced
72120
Your Salesforce sandbox username appends the sandbox name to your Salesforce production username. For example, if a username for a production org is `[email protected]` and the sandbox is named `test`, the username to log in to the sandbox is `[email protected]`.
73121

74122
### How do I add custom fields?
75-
Custom fields can be included in the Other Fields mapping. Custom fields must be predefined in your Salesforce account and should end with `__c` (i.e. `My_Custom_Field__c`). Please include the `__c` in your mapping.
123+
Custom fields can be included in the Other Fields mapping. Custom fields must be predefined in your Salesforce account and should end with `__c` (for example, `My_Custom_Field__c`). Please include the `__c` in your mapping.
76124

77125
You can see Salesforce API names in Salesforce under **Setup > Objects and Fields > Object Manager > Select your object > Fields & Relationships > FIELD NAME**.
78126

src/connections/destinations/catalog/actions-wisepops/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ title: Wisepops Destination
33
hide-boilerplate: true
44
hide-dossier: true
55
id: 6372e1e36d9c2181f3900834
6-
private: true
76
---
87

98
{% include content/plan-grid.md name="actions" %}

0 commit comments

Comments
 (0)