All docs

Start

  1. 01Getting started
  2. 02Install
  3. 03Tracking

Features

  1. 04The dashboard
  2. 05Campaigns
  3. 06Goals & Conversions
  4. 07Funnels
  5. 08Short links
  6. 09Custom domains
  7. 10Importing history
  8. 11AI sources and agents
  9. 12Email reports
  10. 13Scheduled check
  11. 14Ask your AI
  12. 15Runlight for Mac

Reference

  1. 16Performance
  2. 17Configuration
  3. 18HTTP API

Platforms

  1. 19Standalone server
  2. 20ClickHouse
  3. 21PHP
  4. 22WordPress
  5. 23Drupal
  6. 24Craft CMS
  7. 25Webflow
  8. 26Python
  9. 27Rails
  10. 28Ruby
  11. 29Go
  12. 30Java
  13. 31.NET
  14. 32Elixir
  15. 33Rust

Trust

  1. 34Privacy

Features

Custom domains

Add a domain of your own, such as stats.example.com, to load the script from it and to serve short links on it.

A custom domain is a name you own, such as stats.example.com or t.example.com, that points at Runlight. Once it works, the tracking script can load from it, and short links live at its root, as in t.example.com/sale. One domain does both, and a site can have several.

Add a domain

Custom domains are under Settings, Custom domains. The page lists the steps with your own addresses filled in.

  1. At your DNS provider, add a CNAME record for the subdomain that points at the host the dashboard runs on. A bare domain with no subdomain takes an A or ALIAS record to the same server instead.
  2. Make your host accept the domain and serve HTTPS for it. On Vercel or Netlify, add it to the project’s domains. On a server of your own, add it to the web server’s config and to its certificate.
  3. Add the domain in Settings, Custom domains. Runlight then checks that requests to it reach the dashboard, and shows whether they do.

When Runlight runs inside your app, requests on the domain have to reach it before your own routes do. Short links shows the one call that does this for each framework. The standalone server needs nothing more.

A custom domain can never be the dashboard’s own domain or one of your sites, since it answers every path on it. It also has to be a public name, so names kept for private networks, such as .internal or .local, are refused. Using a coding assistant? Copy prompt on the same page copies these steps with your addresses filled in, to paste into it.

Load the script from it

Until a site has a domain under its own name, Settings, Install offers to add one, such as stats.example.com for example.com, and so do the steps on the dashboard of a site waiting for its first visit. Add it there before you put the script on your pages, and the DNS record and the check show beside the script. Once the check passes, the script tag loads from that domain, so you add the tag only once.

A domain added under Custom domains works too. Pick it under Load it from in Settings, Install, which offers only domains whose check passes. For an app with Runlight at /runlight, the script tag then reads like this.

html

<script defer src="https://stats.example.com/runlight/s.js"></script>

The script sends its visits back to the same domain. When that domain is a subdomain of your site, the script and its visits stay on your site’s own name, where ad blockers leave them alone more often than a third-party address.

With a custom domain in place, New link in the Links box offers it beside your app’s own /go path. A link on it lives at the domain’s root, such as t.example.com/sale, and each click is counted like a visit, as Short links describes. Links imported from Dub, Bitly, Short.io, or Rebrandly that used a branded domain bring that domain along under Custom domains.

Remove a domain

Remove beside a domain takes it off. Its links keep their clicks and move to /go/<slug> on your app until you add the domain back, when they return to it. A script tag that loads from the domain stops working, so change the tag on your pages first.

The dashboard’s own paths, such as /runlight, always reach Runlight on a custom domain, so you can still open the dashboard there to remove it.