Skip to content

Commit fe76f94

Browse files
authored
Update custom-proxy.md
1 parent 8b3f48a commit fe76f94

File tree

1 file changed

+19
-17
lines changed
  • src/connections/sources/catalog/libraries/website/javascript

1 file changed

+19
-17
lines changed

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

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,25 @@ A Segment Customer Success team member will respond that they have enabled this
5757
5858

5959
## Custom CDN / API Proxy
60-
### [`npm`](https://www.npmjs.com/package/@segment/analytics-next) library-users instructions
60+
61+
### Snippet instructions
62+
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>`.
63+
64+
To proxy settings and destination requests that typically go to `http://cdn.segment.com`, replace:
65+
```diff
66+
- t.src="https://cdn.segment.com/analytics.js/v1/" + key + "/analytics.min.js"
67+
+ t.src="https://MY-CUSTOM-CDN-PROXY.com" + key + "/analytics.min.js"
68+
```
69+
70+
To proxy tracking calls that typically go to `api.segment.io/v1`, replace:
71+
```diff
72+
- analytics.load("<MY_WRITE_KEY>")
73+
+ analytics.load("<MY_WRITE_KEY>", { integrations: { "Segment.io": { apiHost: "MY-CUSTOM-API-PROXY.com" }}})
74+
```
75+
76+
### npm instructions
77+
See the [`npm` library-users instructions](https://www.npmjs.com/package/@segment/analytics-next){:target="_blank"} for more information.
78+
6179
Proxy settings and destination requests that typically go to `http://cdn.segment.com` through a custom proxy.
6280

6381
```ts
@@ -89,22 +107,6 @@ const analytics = AnalyticsBrowser.load(
89107
)
90108
```
91109

92-
### Snippet instructions
93-
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>`.
94-
95-
To proxy settings and destination requests that typically go to `http://cdn.segment.com`, replace:
96-
```diff
97-
- t.src="https://cdn.segment.com/analytics.js/v1/" + key + "/analytics.min.js"
98-
+ t.src="https://MY-CUSTOM-CDN-PROXY.com" + key + "/analytics.min.js"
99-
```
100-
101-
To proxy tracking calls that typically go to `api.segment.io/v1`, replace:
102-
```diff
103-
- analytics.load("<MY_WRITE_KEY>")
104-
+ analytics.load("<MY_WRITE_KEY>", { integrations: { "Segment.io": { apiHost: "MY-CUSTOM-API-PROXY.com" }}})
105-
```
106-
107-
108110
## CloudFront
109111

110112
These instructions refer to Amazon CloudFront, but apply more generally to other providers as well.

0 commit comments

Comments
 (0)