You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/connections/sources/catalog/libraries/website/javascript/custom-proxy.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,7 @@ Follow these instructions after setting up a proxy such as [CloudFront](#custom-
67
67
> 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.
68
68
69
69
### 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:
71
71
72
72
To proxy CDN settings and destination requests that typically go to `https://cdn.segment.com`, replace:
73
73
```diff
@@ -82,9 +82,9 @@ To proxy API tracking calls that typically go to `api.segment.io/v1`, replace:
82
82
```
83
83
84
84
### 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:
86
86
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:
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`:
102
102
```ts
103
103
const analytics =AnalyticsBrowser.load(
104
104
{
@@ -177,4 +177,5 @@ To add a CNAME record to your DNS settings:
177
177
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.
178
178
179
179
> 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.
0 commit comments