Skip to main content
Installing Radar is a two-part process. First, you’ll perform a one-time setup to brand the tracking infrastructure with your own domains. After that, you’ll follow a simple workflow to generate and deploy a unique tracker for each of your customers.

Prerequisites

Before installing Radar, ensure you have:
  • A Snitcher account with Radar access. Contact support to enable it.
  • Your API key for accessing the Radar Operator API.

Part 1: One-Time Branding Setup (Whitelabeling)

This branding setup is highly recommended for a true whitelabel experience. However, it is optional. If you prefer to get started quickly without configuring custom domains, you can skip this section and use the default Snitcher-branded hosts in your loader script:

CDN Host: cdn.snitcher.com
API Host: radar.snitcher.com
To make Radar feel completely native to your product, you’ll proxy its core services through your own branded domains. This is crucial for maintaining a seamless user experience and ensuring first-party data collection. The following guides walk through setting this up with AWS CloudFront, a common and reliable choice.
This proxy serves the radar.js script from your domain, building trust and improving reliability.
1

1. Create CloudFront Distribution

Log in to the AWS Console, navigate to CloudFront, and click Create distribution.

CloudFront Settings

  • Origin
    • Origin domain: cdn.snitcher.com
    • Protocol: HTTPS only
  • Default cache behavior
    • Viewer protocol policy: Redirect HTTP to HTTPS
    • Allowed HTTP methods: GET, HEAD, OPTIONS
    • Cache policy: We recommend CachingOptimized (the default).
  • Settings
    • Alternate domain name (CNAME): Enter your desired subdomain, e.g., cdn.your-app.com.
    • Custom SSL certificate: Select or request a certificate for your CNAME. This is required by AWS to serve traffic from your custom domain.
Click Create distribution. Once it’s deployed, copy the Distribution domain name (e.g., d12345abcdef.cloudfront.net) for the next step.
2

2. Add CNAME Record in Your DNS

In your domain registrar’s DNS panel, create a new CNAME record pointing your branded subdomain to CloudFront.
  • Type: CNAME
  • Name / Host: cdn (or cdn.your-app, depending on your provider)
  • Value / Points to: The CloudFront Distribution domain name you just copied.
Save the record. DNS changes can take a few minutes to a few hours to propagate.
3

3. Verify the Setup

Once DNS has updated, run the following command. A 403 Forbidden response confirms the proxy is correctly pointed at Radar’s CDN but is blocking direct listing, which is expected.
curl -I https://cdn.your-app.com
This proxy routes all tracking data through your branded endpoint, making Radar’s infrastructure invisible.
1

1. Create CloudFront Distribution

Create a second CloudFront distribution with settings optimized for a real-time API.

CloudFront Settings

  • Origin
    • Origin domain: radar.snitcher.com
    • Protocol: HTTPS only
  • Default cache behavior
    • Viewer protocol policy: Redirect HTTP to HTTPS
    • Allowed HTTP methods: GET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE
    • Cache policy: CachingDisabled (managed policy). This is critical to ensure all API requests pass through to Radar without being cached.
    • Origin request policy: AllViewerExceptHostHeader (managed policy). This ensures headers, cookies, and query strings are forwarded to the Radar API.
  • Settings
    • Alternate domain name (CNAME): api.your-app.com
    • Custom SSL certificate: Select or request a certificate for your CNAME.
Create the distribution and copy the new Distribution domain name.
2

2. Add CNAME Record in Your DNS

Create another CNAME record in your DNS settings:
  • Type: CNAME
  • Name / Host: api (or api.your-app)
  • Value / Points to: The CloudFront Distribution domain name for your API proxy.
3

3. Verify the Setup

Run a curl command to verify the API proxy. The server should respond, confirming the connection is live.
curl https://api.your-app.com

Part 2: Customer Installation Workflow

Once your branded domains are ready, you can start generating trackers for your customers.
1

Generate a Tracking Script

For each customer, make a POST request to the Generate a Tracking Script endpoint.Include an internal_identifier that maps to the customer’s ID in your own system. This identifier will be included in every webhook event, making it easy to associate data with the correct customer account.
curl -X POST 'https://api.snitcher.com/radar/operator/v1/tracking-scripts' \
     -H 'Authorization: Bearer YOUR_API_KEY' \
     -H 'Content-Type: application/json' \
     -d '{
       "internal_identifier": "customer-abc-123",
       "description": "Tracking script for Customer ABC"
     }'
You’ll receive a unique tracking_script_id for this customer.
2

Provide the Loader Script

Construct the loader script for your customer to install on their website. It’s crucial to populate the configuration object with your branded domains and the tracking_script_id you just generated.
HTML
<script>
  !function(e){"use strict";var a=e&&e.namespace;if(a&&e.profileId&&e.cdn){var r=window[a];if(r&&Array.isArray(r)||(r=window[a]=[]),!r.initialized&&!r._loaded)if(r._loaded)console&&console.warn("[Radar] Duplicate initialization attempted");else{r._loaded=!0;["track","page","identify","group","alias","ready","debug","on","off","once","trackClick","trackSubmit","trackLink","trackForm","pageview","screen","reset","register","setAnonymousId","addSourceMiddleware","addIntegrationMiddleware","addDestinationMiddleware"].forEach((function(e){var i;r[e]=(i=e,function(){var e=window[a];if(e.initialized)return e[i].apply(e,arguments);var r=[].slice.call(arguments);return r.unshift(i),e.push(r),e})})),r.bootstrap=function(){var a=document.createElement("script");a.async=!0,a.type="text/javascript",a.id="__radar__",a.dataset.settings=JSON.stringify(e),a.src="https://"+e.cdn+"/releases/latest/radar.min.js";var r=document.scripts[0];r.parentNode.insertBefore(a,r)},r.bootstrap()}}else"undefined"!=typeof console&&console.error("[Radar] Configuration incomplete")}({
    "cdn": "cdn.your-app.com",
    "apiEndpoint": "api.your-app.com",
    "profileId": "ts_a1b2c3d4e5f6g7h8",
    "namespace": "YourAppName"
    "waitForConsent": true
  });
</script>
Configuration Parameters:
  • cdn: (Required) Your custom CDN proxy domain (e.g., cdn.your-app.com).
  • apiEndpoint: (Required) Your custom API proxy domain (e.g., api.your-app.com).
  • profileId: (Required) The unique tracking_script_id generated for the customer.
  • namespace: (Required) The name of the global JavaScript object your customers will use to interact with the tracker (e.g., YourAppName). This allows them to call functions like YourAppName.track("Custom Event"). We recommend using a single, consistent namespace across your entire customer base. This simplifies your own documentation, as you can always instruct your customers to use the same object name. It also prevents conflicts with other scripts on your customer’s site.
  • waitForConsent: (Optional) When set to true, the tracker will wait until a visitor has given cookie consent before saving any data in their browser. If consent isn’t given, the tracker will still work but will only keep data for the current visit (not saved after the browser is closed). The default is false. See Consent Management for more details
All of these settings and more can be customized. See the full Configuration Reference for a complete list of options, including how to enable powerful features like automatic session, form, and click tracking.
3

Verify Installation & Receive Events

Ask your customer to place the script in the <head> section of their website. Once the script is live, Radar will immediately begin to capture events.You can verify the installation is working by checking your configured webhook endpoint for incoming data.
I