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.
- 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.
- 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.
- 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.
Short links on it
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.