Relay proxy
The Smartlook relay proxy relays HTTP requests from your subdomain to Smartlook's recording domains, allow you to bypass potential browser settings or extensions configured to limit data capture. You will have to have access to your server. If you do not have access to your server, contact your developer.
The Relay Proxy is developed as an open source project. If you are experiencing an issues, be sure that you are using the most recent version of the relay proxy. If the issues persist, go to the Smartlook Relay Proxy GitHub to open an issue, or contact our support.
You can also visit the open source Smartlook relay proxy GitHub repository.
Web-based projects supported
The Smartlook relay proxy only supports web-based projects.
Installation and deployment
To install and deploy the Smartlook relay proxy:
- Go to Docker Hub to get the Smartlook relay proxy image.
- Run the image and configure environment variables to your needs.
docker run --name="smartlook-relay-proxy" -d \ # can be also set with "--env-file" -e LOGGER_LEVEL=<level> \ -e MANAGER_HOST=<host> \ -e WEB_SDK_WRITER_HOST=<host> \ -e ASSETS_PROXY_HOST=<host> \ -p <port>:8000 \ # mapping is optional, internally runs on port 8000 smartlook/relay-proxy:latest
- Create a subdomain and point it to the container. It is best to use a subdomain of your website's domain.
- Deploy the following script. Be sure to replace any URLs with your own URLs. Do not set
region
.<script> window.smartlook || (function (d) { var o = (smartlook = function () { o.api.push(arguments) }), h = d.getElementsByTagName('head')[0]; var c = d.createElement('script'); o.api = new Array(); c.async = true; c.crossOrigin = 'anonymous'; c.type = 'text/javascript'; c.charset = 'utf-8'; c.src = 'https://<your-relay-proxy-host>/recorder.js'; h.appendChild(c); })(document); smartlook('init', <project-key>, { host: '<your-relay-proxy-host>' }); </script>
You have now installed and deployed the Smartlook relay proxy. You can check if the relay proxy is working correctly by seeing requests sent through your subdomain in the Network tab of your browser DevTools.
Environment variables
All variables are optional. The default values are listed in the table:
Name | Type | Default value | Description | Notes |
---|---|---|---|---|
LOGGER_LEVEL | string | info | One of:trace , debug , info , warn , error , fatal , silent | Can be overridden |
MANAGER_HOST | string | https://manager.eu.smartlook.cloud | Smartlook manager host | Only edit this value if using a region other than EU, or if instructed by customer support |
WEB_SDK_WRITER_HOST | string | https://web-writer.eu.smartlook.cloud | Smartlook web writer host | Only edit this value if using a region other than EU, or if instructed by customer support |
ASSETS_PROXY_HOST | string | https://assets-proxy.smartlook.cloud | Smartlook assets proxy host | Only edit this value if using a region other than EU, or if instructed by customer support |
PROXY_PORT | number | 8000 | Port where the HTTP server listens | Can be overridden |
Regional data storage setup
If your Smartlook organization is set up to store data in a region other than the EU, you must set the environment variables based on your location.
Example environment variables if based in the US:
Name | Value |
---|---|
MANAGER_HOST | https://manager.us.smartlook.cloud |
WEB_SDK_WRITER_HOST | https://web-writer.us.smartlook.cloud |
ASSETS_PROXY_HOST | https://assets-proxy.us.smartlook.cloud |
License
Updated about 2 months ago