You can run Hightouch Events on a custom domain by setting up a proxy. When using a proxy, clients send their event data to your domain rather than directly to Hightouch. This lets you have more control over your data.
Prerequisites
You'll need a certificate for whatever domain you plan to use for the proxy.
This guide uses Amazon Cloudfront, but any CDN or reverse proxy will work.
Proxying events
By default, events are sent to hightouch-events.com
. But you can configure Hightouch to send events to your own domain instead.
First, create a Cloudfront distribution with the following settings:
Setting | Value |
---|---|
Origin domain | us-east-1.hightouch-events.com |
Origin path | Leave this blank |
Name | Give your distribution a unique name |
Enable Origin Shield | No |
Compress objects automatically | Yes |
Viewer protocol policy | HTTPS only |
Allowed HTTP methods | GET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE |
Restrict viewer access | No |
Cache key and origin requests | Cache policy and origin request policy |
Cache policy | CachingDisabled |
Origin request policy | AllViewer |
Response headers policy | None |
Function associations | No associations |
Alternate domain name (CNAME) | The domain you want to expose to clients |
Custom SSL certificate | Select a certificate that corresponds to the CNAME you entered |
Supported HTTP versions | Enable HTTP/2 and HTTP/3 |
Default root object | Leave this blank |
Standard logging | Off |
IPv6 | On |
Then, set your SDK's apiHost
setting to the CNAME you configured. For example, if you are using the Browser SDK:
HtEventsBrowser.load(
{ writeKey: "WRITE_KEY" },
{ apiHost: "events.example.com" }
);