Skip to content

Commit 40fe21f

Browse files
vanand17prigiattiperrutmarkzegarelli
authored
Update custom-proxy.md (#4606)
* Update custom-proxy.md * Updated the page title and Self Hosting section Renaming the page, so it includes the new option that's being added. Fixing the link to the NPM instructions. * Update src/connections/sources/catalog/libraries/website/javascript/custom-proxy.md Co-authored-by: markzegarelli <[email protected]> * Update src/connections/sources/catalog/libraries/website/javascript/custom-proxy.md --------- Co-authored-by: prigiattiperrut <[email protected]> Co-authored-by: markzegarelli <[email protected]>
1 parent 11448e6 commit 40fe21f

File tree

1 file changed

+12
-4
lines changed
  • src/connections/sources/catalog/libraries/website/javascript

1 file changed

+12
-4
lines changed

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
title: Set up a custom domain proxy for Analytics.js
2+
title: Self Hosting or Proxying Analytics.js
33
redirect_from: '/connections/sources/custom-domains/'
44
strat: ajs
55
---
66

77
Custom domains allow you to proxy Analytics.js and proxy all tracking event requests through your domain.
88

9-
## Prerequisites
9+
## Custom Proxy Prerequisites
1010

1111
To set up a custom domain, you need:
1212

@@ -31,7 +31,7 @@ You need to set up two important parts, regardless of the CDN provider you use:
3131
> info ""
3232
> Segment only has the ability to enable the proxy setting for the Web (Analytics.js) source. Details for mobile source proxies are in the [Analytics for iOS](/docs/connections/sources/catalog/libraries/mobile/ios/#proxy-https-calls) and [Analytics for Android](/docs/connections/sources/catalog/libraries/mobile/android/#proxying-http-calls) documentation. It is not currently possible to set up a proxy for server sources using the Segment UI.
3333
34-
## Set up
34+
## Custom Proxy Set up
3535

3636
There are 2 options you can choose from when you set up your custom domain proxy.
3737
1. [CloudFront](#cloudfront)
@@ -114,7 +114,7 @@ const analytics = AnalyticsBrowser.load(
114114
)
115115
```
116116

117-
## CloudFront
117+
## Custom Proxy CloudFront
118118

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

@@ -166,3 +166,11 @@ To add a CNAME record to your DNS settings:
166166
- **Value**: Tracking API CloudFront Distribution Domain Name
167167
3. Save your record. This might take some time to take effect, depending on your TTL settings.
168168
4. Run `curl` on your domain to check if the proxy is working correctly.
169+
170+
171+
## Self Hosting Analytics.js
172+
173+
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.
174+
175+
> warning "Keep in mind"
176+
> 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. Self-hosting Analytics.js requires

0 commit comments

Comments
 (0)