Skip to content

Commit de72331

Browse files
Merge pull request #5967 from segmentio/sarahrudy-patch-17
Custom proxy update
2 parents afa1a30 + c3fa5ae commit de72331

File tree

1 file changed

+6
-5
lines changed
  • src/connections/sources/catalog/libraries/website/javascript

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Follow these instructions after setting up a proxy such as [CloudFront](#custom-
6767
> If you've followed the instructions above to have a Segment team member enable the apiHost settings in the UI, you can skip the instructions in this section.
6868
6969
### Snippet instructions
70-
If you're a snippet user, you need to modify the [analytics snippet](/docs/getting-started/02-simple-install/#step-1-copy-the-snippet) that's inside your `<head>`.
70+
If you're a snippet user, modify the [analytics snippet](/docs/getting-started/02-simple-install/#step-1-copy-the-snippet) located inside the `<head>` of your website:
7171

7272
To proxy CDN settings and destination requests that typically go to `https://cdn.segment.com`, replace:
7373
```diff
@@ -82,9 +82,9 @@ To proxy API tracking calls that typically go to `api.segment.io/v1`, replace:
8282
```
8383

8484
### npm instructions
85-
See the [`npm` library-users instructions](https://www.npmjs.com/package/@segment/analytics-next){:target="_blank"} for more information.
85+
If you're using the [npm library](https://www.npmjs.com/package/@segment/analytics-next){:target="_blank"}, make the following changes directly in your code:
8686

87-
Proxy settings and destination requests that typically go to `https://cdn.segment.com` through a custom proxy.
87+
To proxy settings and destination requests that typically go to `https://cdn.segment.com` through a custom proxy:
8888

8989
```ts
9090
const analytics = AnalyticsBrowser.load({
@@ -98,7 +98,7 @@ const analytics = AnalyticsBrowser.load({
9898
})
9999
```
100100

101-
Proxy tracking calls that typically go to `api.segment.io/v1` by configuring `integrations['Segment.io'].apiHost`.
101+
To proxy tracking calls that typically go to `api.segment.io/v1`, configure the `integrations['Segment.io'].apiHost`:
102102
```ts
103103
const analytics = AnalyticsBrowser.load(
104104
{
@@ -177,4 +177,5 @@ To add a CNAME record to your DNS settings:
177177
Follow the instructions at [Using Analytics.js as an NPM Package](https://github.com/segmentio/analytics-next/tree/master/packages/browser#-using-as-an-npm-package), to host Analytics.js and eliminate the requirement of downloading it from the CDN file during every page load. This enables you to self-host/import the library itself.
178178

179179
> warning ""
180-
> Segment does not recommend self-hosting, as it requires that you configure integration settings individually and manually redeploy Analytics.js when there are changes to your settings. When you enable third-party libraries in device-mode, Segment loads them, which defeats the purpose of self-hosting.
180+
> Segment does not recommend self-hosting, as it requires that you configure integration settings individually and manually redeploy Analytics.js when there are changes to your settings. Self-hosting your own Analytics.js instead of using the CDN means that you lose the automatic downstream updates to your analytics when you make changes. Self-hosting means that you must configure the settings for each integration directly and redeploy your Analytics.js any time you make changes to your settings. When you enable third-party libraries in device-mode, Segment loads them for you, which defeats the purpose of self-hosting.
181+

0 commit comments

Comments
 (0)