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

Skip to content

Fixed several links + improved the linkchecker #2371

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 11 commits into from
Jan 20, 2022
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
34 changes: 34 additions & 0 deletions ignore-links.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
https://www.linkedin.com/company/segment-io/
https://support.twilio.com/hc/en-us/articles/223136127-Twilio-Support-business-hours
https://support.cloudflare.com/hc/en-us/articles/360020348832-How-do-I-do-CNAME-setup-
https://github.com/segment-integrations/analytics.js-integration-adlearn-open-platform
https://github.com/segment-integrations/analytics.js-integration-adobe-analytics
https://marketing.adobe.com/resources/help/en_US/sc/implement/context_data_variables.html
https://marketing.adobe.com/resources/help/en_US/sc/implement/timestamps-overview.html
https://help.adroll.com/hc/en-us/articles/213429827-Currency-Codes
https://github.com/GetAmbassador/segment/blob/master/lib/index.js
https://help.amplitude.com/hc/en-us/articles/235649848-Settings#general
https://help.amplitude.com/hc/en-us/articles/115002923888-Limits#h_8d90ca72-bf91-4161-88b2-01b5448b0859
https://help.amplitude.com/hc/en-us/articles/360017800371
https://help.amplitude.com/hc/en-us/articles/360003032451-Instrumentation-Explorer-Debugger
https://amplitude.com/settings
https://support.anodot.com/hc/en-us/articles/360018508380-Segment-Integration
https://support.anodot.com/hc/en-us/articles/360009537879-Mapping-Dimensions-to-Measures-BETA-
https://github.com/segment-integrations/analytics.js-integration-appnexus
https://support.appsflyer.com/hc/en-us/articles/207034486-Server-to-Server-In-App-Events-API-HTTP-API-
https://support.appsflyer.com/hc/en-us/articles/207032246-OneLink-Setup-Guide
https://support.appsflyer.com/hc/en-us/articles/207032066-AppsFlyer-SDK-Integration-iOS
https://support.appsflyer.com/hc/en-us/articles/207032126-AppsFlyer-SDK-Integration-Android
https://support.autopilothq.com/hc/en-us/categories/200396835-Segment
https://support.autopilothq.com/hc/en-us/requests/new
https://support.autopilothq.com/hc/en-us/articles/203658119
https://bugsnag.com/dashboard
https://github.com/segment-integrations/analytics.js-integration-clevertap
https://github.com/segment-integrations/analytics.js-integration-convertro
https://github.com/segment-integrations/analytics.js-integration-criteo
https://app.dreamdata.io/settings
https://www.getdrip.com/settings/site
https://github.com/segment-integrations/analytics.js-integration-eloqua
https://github.com/segment-integrations/analytics.js-integration-email-aptitude
https://platform.epica.ai/login
https://github.com/segment-integrations/analytics.js-integration-friendbuy
40 changes: 30 additions & 10 deletions scripts/checklinks-external.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,41 +22,61 @@ const checkForDeadExternalUrls = async () => {
const ph = posthtml([
require('posthtml-urls')({
eachURL: (url) => {
if (!url.startsWith('http://0') && !url.startsWith('/') && !url.startsWith('https://github.com/segmentio')) {
if (!url.startsWith('http://0') && !url.startsWith('/') && !url.startsWith('https://github.com/segmentio')) {
urls.add(url)
}
},
}),
])
throbber.succeed()
throbber.start('Processing files')

// Run the above logic on each file
files.forEach((file) => {
ph.process(fs.readFileSync(file))
})


// Check all the links collected in the section above
throbber.succeed()
throbber.start('Checking the links')
const results = await checkLinks(
Array.from(urls).map((url) =>
url
),
)
)

// If a link returns 'dead' (404), add it to an array
const deadUrls = Array.from(urls).filter(
(url) => results[url].status === 'dead',
(url) => results[url].statusCode === 404,
)


// Get the ignore list
throbber.succeed()
throbber.start('Get the ignore list')
const readFileLines = filename =>
fs.readFileSync(filename)
.toString('UTF8')
.split('\n')

let ignoreList = readFileLines('ignore-links.txt')

throbber.succeed()

// Filter the ignored links
throbber.start('Filter the ignored URls')
let broke = []
broke = deadUrls.filter(val => !ignoreList.includes(val));

// If there are dead URLs, list them here, along with the count. Exit status 1 to indicate an error.
if (deadUrls.length > 0) {
throbber.fail(`Dead URLS: ${deadUrls.length}\n\n`)
console.log(`Dead URLS: ${deadUrls.length}\n\n${deadUrls.join('\n')}`)
if (broke.length > 0) {
throbber.fail(`Dead URLS: ${broke.length}\n\n`)
console.log(`Dead URLS: ${broke.length}\n\n${broke.join('\n')}`)
process.exit(1)
}
}
// Otherwise, claim that all the links work, and exit the process normally.
else {
throbber.succeed()
console.log('All links work!')
process.exit
}
Expand Down
10 changes: 10 additions & 0 deletions scripts/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const checkLinks = require('check-links')

const check = async () => {
const url = process.argv[2]
const results = await checkLinks([url])
console.log(results)

}

check()
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Braze Web Mode (Actions) can use the following features of Braze.

### In-app Messaging

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

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:

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

### Push Notifications

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"}.
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"}.

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

Expand Down Expand Up @@ -94,13 +94,13 @@ analytics.ready(function() {
});
```

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"}.
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"}.

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"}.
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"}.

### Soft Push Prompts

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

2. Add the following snippet to your site:

Expand Down Expand Up @@ -141,7 +141,7 @@ analytics.ready(function() {
});
```

For more details on this snippet, see Braze's documentation [here](https://www.braze.com/documentation/Web/#soft-push-prompts){:target="_blank"}.
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"}.

> info ""
> 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Segment's server-side integration is not open-source. Let's explore what happens

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

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>`.
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>`.

(In Node.js)
```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ When you make a `page` call, here's what Segment does from the browser when you

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`.

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

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

Expand Down
Loading