Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 38d293d

Browse files
markzegarellirchinn1
markzegarelli
andauthored
Fixed several links + improved the linkchecker (segmentio#2371)
* add link ignore support and file * fixes * fix * fix * only return 404s. 403 ok (looking at you Zendesk) * fixes * Update src/connections/destinations/catalog/actions-braze-web/index.md Co-authored-by: rchinn-segment <[email protected]> * Apply suggestions from code review Co-authored-by: rchinn-segment <[email protected]> * Apply suggestions from code review Co-authored-by: rchinn-segment <[email protected]> * Update src/connections/destinations/catalog/amplitude/index.md Co-authored-by: rchinn-segment <[email protected]> Co-authored-by: rchinn-segment <[email protected]>
1 parent 4656014 commit 38d293d

File tree

21 files changed

+190
-123
lines changed

21 files changed

+190
-123
lines changed

ignore-links.txt

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
https://www.linkedin.com/company/segment-io/
2+
https://support.twilio.com/hc/en-us/articles/223136127-Twilio-Support-business-hours
3+
https://support.cloudflare.com/hc/en-us/articles/360020348832-How-do-I-do-CNAME-setup-
4+
https://github.com/segment-integrations/analytics.js-integration-adlearn-open-platform
5+
https://github.com/segment-integrations/analytics.js-integration-adobe-analytics
6+
https://marketing.adobe.com/resources/help/en_US/sc/implement/context_data_variables.html
7+
https://marketing.adobe.com/resources/help/en_US/sc/implement/timestamps-overview.html
8+
https://help.adroll.com/hc/en-us/articles/213429827-Currency-Codes
9+
https://github.com/GetAmbassador/segment/blob/master/lib/index.js
10+
https://help.amplitude.com/hc/en-us/articles/235649848-Settings#general
11+
https://help.amplitude.com/hc/en-us/articles/115002923888-Limits#h_8d90ca72-bf91-4161-88b2-01b5448b0859
12+
https://help.amplitude.com/hc/en-us/articles/360017800371
13+
https://help.amplitude.com/hc/en-us/articles/360003032451-Instrumentation-Explorer-Debugger
14+
https://amplitude.com/settings
15+
https://support.anodot.com/hc/en-us/articles/360018508380-Segment-Integration
16+
https://support.anodot.com/hc/en-us/articles/360009537879-Mapping-Dimensions-to-Measures-BETA-
17+
https://github.com/segment-integrations/analytics.js-integration-appnexus
18+
https://support.appsflyer.com/hc/en-us/articles/207034486-Server-to-Server-In-App-Events-API-HTTP-API-
19+
https://support.appsflyer.com/hc/en-us/articles/207032246-OneLink-Setup-Guide
20+
https://support.appsflyer.com/hc/en-us/articles/207032066-AppsFlyer-SDK-Integration-iOS
21+
https://support.appsflyer.com/hc/en-us/articles/207032126-AppsFlyer-SDK-Integration-Android
22+
https://support.autopilothq.com/hc/en-us/categories/200396835-Segment
23+
https://support.autopilothq.com/hc/en-us/requests/new
24+
https://support.autopilothq.com/hc/en-us/articles/203658119
25+
https://bugsnag.com/dashboard
26+
https://github.com/segment-integrations/analytics.js-integration-clevertap
27+
https://github.com/segment-integrations/analytics.js-integration-convertro
28+
https://github.com/segment-integrations/analytics.js-integration-criteo
29+
https://app.dreamdata.io/settings
30+
https://www.getdrip.com/settings/site
31+
https://github.com/segment-integrations/analytics.js-integration-eloqua
32+
https://github.com/segment-integrations/analytics.js-integration-email-aptitude
33+
https://platform.epica.ai/login
34+
https://github.com/segment-integrations/analytics.js-integration-friendbuy

scripts/checklinks-external.js

+30-10
Original file line numberDiff line numberDiff line change
@@ -22,41 +22,61 @@ const checkForDeadExternalUrls = async () => {
2222
const ph = posthtml([
2323
require('posthtml-urls')({
2424
eachURL: (url) => {
25-
if (!url.startsWith('http://0') && !url.startsWith('/') && !url.startsWith('https://github.com/segmentio')) {
25+
if (!url.startsWith('http://0') && !url.startsWith('/') && !url.startsWith('https://github.com/segmentio')) {
2626
urls.add(url)
2727
}
2828
},
2929
}),
3030
])
3131
throbber.succeed()
3232
throbber.start('Processing files')
33-
33+
3434
// Run the above logic on each file
3535
files.forEach((file) => {
3636
ph.process(fs.readFileSync(file))
3737
})
3838

39-
39+
4040
// Check all the links collected in the section above
41+
throbber.succeed()
4142
throbber.start('Checking the links')
4243
const results = await checkLinks(
4344
Array.from(urls).map((url) =>
4445
url
45-
),
46+
)
4647
)
48+
4749
// If a link returns 'dead' (404), add it to an array
4850
const deadUrls = Array.from(urls).filter(
49-
(url) => results[url].status === 'dead',
51+
(url) => results[url].statusCode === 404,
5052
)
51-
53+
54+
// Get the ignore list
55+
throbber.succeed()
56+
throbber.start('Get the ignore list')
57+
const readFileLines = filename =>
58+
fs.readFileSync(filename)
59+
.toString('UTF8')
60+
.split('\n')
61+
62+
let ignoreList = readFileLines('ignore-links.txt')
63+
64+
throbber.succeed()
65+
66+
// Filter the ignored links
67+
throbber.start('Filter the ignored URls')
68+
let broke = []
69+
broke = deadUrls.filter(val => !ignoreList.includes(val));
70+
5271
// If there are dead URLs, list them here, along with the count. Exit status 1 to indicate an error.
53-
if (deadUrls.length > 0) {
54-
throbber.fail(`Dead URLS: ${deadUrls.length}\n\n`)
55-
console.log(`Dead URLS: ${deadUrls.length}\n\n${deadUrls.join('\n')}`)
72+
if (broke.length > 0) {
73+
throbber.fail(`Dead URLS: ${broke.length}\n\n`)
74+
console.log(`Dead URLS: ${broke.length}\n\n${broke.join('\n')}`)
5675
process.exit(1)
57-
}
76+
}
5877
// Otherwise, claim that all the links work, and exit the process normally.
5978
else {
79+
throbber.succeed()
6080
console.log('All links work!')
6181
process.exit
6282
}

scripts/test.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const checkLinks = require('check-links')
2+
3+
const check = async () => {
4+
const url = process.argv[2]
5+
const results = await checkLinks([url])
6+
console.log(results)
7+
8+
}
9+
10+
check()

src/connections/destinations/catalog/actions-braze-web/index.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Braze Web Mode (Actions) can use the following features of Braze.
3434

3535
### In-app Messaging
3636

37-
Find instructions to configure In-app Messaging in the Braze [documentation](https://www.braze.com/academy/Best_Practices/#in-app-message-behavior){:target="_blank"}. Once configured, you can trigger in-app message display as a result of several different event types. By default, all In-App Messages that a user is eligible for are automatically delivered to the user upon a session start event. A new session automatically starts when a user loads your site. If you'd like to force a new session for a user, make an Identify call with the corresponding [userId](/docs/connections/spec/identify/#user-id) for that user.
37+
Once configured, you can trigger in-app message display as a result of several different event types. By default, all In-App Messages that a user is eligible for are automatically delivered to the user upon a session start event. A new session automatically starts when a user loads your site. If you'd like to force a new session for a user, make an Identify call with the corresponding [userId](/docs/connections/spec/identify/#user-id) for that user.
3838

3939
If you don't want your site to display new In-App Messages as they're received, disable automatic display and register your own display subscribers. To do this:
4040

@@ -60,7 +60,7 @@ The `inAppMessages` parameter will be an array of [`appboy.ab.InAppMessage`](htt
6060

6161
### Push Notifications
6262

63-
1. To support push notifications on Chrome, you'll need to enable FCM/GCM as well as configure your site. Check out steps [one and two here, for detailed instructions on both](https://www.braze.com/documentation/Web/#step-1-to-support-chrome-enable-fcmgcm){:target="_blank"}.
63+
1. To support push notifications on Chrome, you'll need to enable FCM/GCM as well as configure your site. Check out steps [one and two here for detailed instructions on both](https://www.braze.com/docs/developer_guide/platform_integration_guides/web/initial_sdk_setup#step-1-to-support-chrome-enable-fcmgcm){:target="_blank"}.
6464

6565
2. Browser Registration. In order for a browser to receive push notifications, you must register it for push by calling:
6666

@@ -94,13 +94,13 @@ analytics.ready(function() {
9494
});
9595
```
9696
97-
1. Set your GCM/FCM server API key and SenderID on the Braze dashboard. You can find more details for this [here](https://www.braze.com/documentation/Web/#step-4-set-your-gcmfcm-server-api-key-and-senderid-on-the-Braze-dashboard){:target="_blank"}.
97+
1. Set your GCM/FCM server API key and SenderID on the Braze dashboard. You can find more details for this [here](https://www.braze.com/docs/developer_guide/platform_integration_guides/web/initial_sdk_setup#step-4-set-your-gcmfcm-server-api-key-and-senderid-on-the-Braze-dashboard){:target="_blank"}.
9898
99-
2. To support push notifications on Safari, add your Website Push ID into your Segment Settings UI and Segment sends it when the Braze Web SDK initializes. To get your Website Push ID, follow the first two bullet points in [these instructions](https://www.braze.com/documentation/Web/#step-5-configure-safari-push){:target="_blank"}.
99+
2. To support push notifications on Safari, add your Website Push ID into your Segment Settings UI and Segment sends it when the Braze Web SDK initializes. To get your Website Push ID, follow the first two bullet points in [these instructions](https://www.braze.com/docs/developer_guide/platform_integration_guides/web/initial_sdk_setup#step-5-configure-safari-push){:target="_blank"}.
100100
101101
### Soft Push Prompts
102102
103-
1. Follow [step one](https://www.braze.com/documentation/Web/#soft-push-prompts){:target="_blank"} to create a "Prime for Push" in-app messaging Campaign on the Braze dashboard.
103+
1. Follow [step one](https://www.braze.com/docs/developer_guide/platform_integration_guides/web/initial_sdk_setup#soft-push-prompts){:target="_blank"} to create a "Prime for Push" in-app messaging Campaign on the Braze dashboard.
104104
105105
2. Add the following snippet to your site:
106106
@@ -141,7 +141,7 @@ analytics.ready(function() {
141141
});
142142
```
143143

144-
For more details on this snippet, see Braze's documentation [here](https://www.braze.com/documentation/Web/#soft-push-prompts){:target="_blank"}.
144+
For more details on this snippet, see Braze's documentation [here](https://www.braze.com/docs/developer_guide/platform_integration_guides/web/initial_sdk_setup#soft-push-prompts){:target="_blank"}.
145145

146146
> info ""
147147
> Place this snippet outside of your [Segment Snippet](/docs/connections/sources/catalog/libraries/website/javascript/quickstart/#step-2-copy-the-segment-snippet) within your `script` tag.

src/connections/destinations/catalog/adobe-analytics/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ Segment's server-side integration is not open-source. Let's explore what happens
145145

146146
**Important**: The Android library can collect the `userAgent` automatically - however, the iOS library cannot do so. However, since Segment does collect other contextual metadata about a device, it can render a valid iOS userAgent string to populate your Mobile Web Reports.
147147

148-
6. If you are using the [Marketing Cloud ID Service](https://marketing.adobe.com/resources/help/en_US/mcvid/mcvid_overview.html), you can pass the **Marketing Cloud Visitor ID** as an destination specific setting and which Segment sets as `<marketingCloudVisitorID>`.
148+
6. If you are using the Marketing Cloud ID Service, you can pass the **Marketing Cloud Visitor ID** as a destination specific setting and which Segment sets as `<marketingCloudVisitorID>`.
149149

150150
(In Node.js)
151151
```javascript

src/connections/destinations/catalog/adobe-analytics/settings.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ When you make a `page` call, here's what Segment does from the browser when you
267267

268268
3. Checks if the page call is associated with a `userId` from a previous `.identify()` call. If so, Segment sets the `userId` as `window.s.visitorID`.
269269

270-
**IMPORTANT**: Adobe Analytics [does not support setting visitorID](https://marketing.adobe.com/resources/help/en_US/sc/implement/timestamps-overview.html) if you are sending a timestamped call. So Segment first checks if your **Timestamp Option** is `disabled` _and_ that a `userId` exists on the event, and only then sets `window.s.visitorID`.
270+
**IMPORTANT**: Adobe Analytics doesn't support setting visitorID if you send a timestamped call. So Segment first checks if your **Timestamp Option** is `disabled` _and_ that a `userId` exists on the event, and only then sets `window.s.visitorID`.
271271

272272
4. Checks for some common properties, and sets them on the `window.s` object:
273273

0 commit comments

Comments
 (0)