Docs / label.js

Hostnames and verification

A site is one exact hostname, verified as yours. This page covers what that means in practice.

Activation (early access)

You can create an account, add a site and verify it today. Labels appear once we have activated the site. We only activate verified sites, so verify yours first (below).

Until then, label.js loads but draws nothing. The browser console shows [disclarion] label API: unavailable.

To request activation, open your project in the dashboard and go to Content labeling. Once the site is verified, click Request activation next to it (until then the dashboard shows Verify your site first instead). It sends us your hostname and site code, and the dashboard shows when the request was sent. We reply by email once the site is activated. If the button doesn't work, write to hello@disclarion.com with both.

The dashboard shows each site as Pending activation or Active since the date we activated it. Once it's activated, the Quickstart works as written.

Before you start

  • An account. Sign up for a 30-day trial. No card needed.
  • A project. In the dashboard, go to Projects, create a project and open it.
  • A site. In the project, click Set up content labeling (or Content labeling). Type your hostname under Sites and click Add site. You can paste a full URL; the dashboard keeps only the hostname.
  • A site code. Each site gets one, like site_0a332db1bace95cba423. It is public: it sits in your HTML. It is not a secret and not an API key.
  • https. Labels are registered only for pages served over https.

Verify your site

Verification proves the hostname is yours. Use one of three methods. The dashboard shows all three, ready to copy, under Show setup.

  • The script tag (recommended). Put it on your homepage at https://your-hostname/ (Quickstart, step 2), then click Check verification.
  • A meta tag, if your homepage can't carry the script. Add <meta name="disclarion-site-verification" content="site_YOUR_SITE_CODE"> to the homepage.
  • A DNS TXT record. Name: _disclarion.your-hostname. Value: disclarion-site-verification=site_YOUR_SITE_CODE.

After verification

We re-check verification every day.

If a check fails, labels already on your pages keep showing, and we email you. If it keeps failing for 30 days, new content stops being registered. Registration resumes when a check passes again.

New content is registered while your account is on a trial, an active subscription or a grace period. If the account fully expires, existing labels and their verify links keep working. New content is not labeled.

How hostnames are matched

A site is one exact hostname. label.js works only on pages with exactly that hostname. The site code in the script tag must belong to it.

CaseWhat happensWhat to do
example.com vs www.example.comTwo different sites. A site added as example.com doesn't work on www.example.com, and the other way round.Add the hostname visitors see in the address bar after any redirect. Redirecting to one hostname is simplest. If you serve both without a redirect, add both, and give each page the site code of its own hostname.
Subdomains (blog.example.com, shop.example.com)Each is its own site, with its own site code.Add each subdomain you want labels on.
PortsThe browser check ignores the port. Our server fetches pages only on the standard https port (443).Serve labeled pages on the standard port.
localhost, IP addresses, plain httpCan't be added as a site. On localhost or http pages, label.js draws nothing.Test on a public https hostname (see the next row).
Staging and preview hostnamesA separate hostname, so a separate site. It must be public, use https and be verified like any other site.Add the staging hostname as its own site. Use its site code in your staging build.
Shared platforms: github.io, netlify.app, vercel.app, pages.dev, webflow.io, wixsite.com, squarespace.com, wordpress.com, blogspot.com and similarCan't be verified. Other customers' sites share the domain, so a script or meta tag doesn't prove the hostname is yours. Only a DNS TXT record would, and the platform controls that domain's DNS, not you.Connect a custom domain to your site and add that hostname.

Hostname mismatch warnings

The dashboard warns you when visitors end up on a different hostname than your site's.

  • When you add a site, the dashboard checks where its homepage ends up. If https://example.com/ redirects to www.example.com, you see: "Site added. https://example.com/ redirects to www.example.com. Visitors end up on www.example.com, so label.js only works there. Add www.example.com as its own site (you can keep both)."
  • After Check verification, the same notice appears. It appears even when the check passes, for example by DNS.
  • Later, if the script runs with your site code on another hostname, the Needs attention list on the Content labeling page shows: "label.js ran with this site's code on another hostname (shown below), so those labels were refused", with that hostname.

In each case, add the hostname your visitors actually use as its own site. Verify it, and use its site code on those pages.

This is an AI-powered assistant.