Layers

Custom Domain

CNAME your own subdomain to in.layers.com for ad-blocker resilience and brand consistency.

View as Markdown

For maximum delivery rates, set up a custom domain that CNAMEs to in.layers.com. Ad-blockers commonly block known analytics domains; your own events.yourdomain.com is rarely blocked.

Setup

  1. Project → Layers → Layers SDK → Custom domain → click Add.
  2. Choose your subdomain (e.g., events.yourdomain.com).
  3. Layers shows the CNAME target (e.g., cdn.layers-edge.com).
  4. In your DNS provider, add the CNAME record:
    events.yourdomain.com.  CNAME  cdn.layers-edge.com.
  5. Click Verify in Layers. Cert provisioning happens within minutes.
  6. Layers issues a Let's Encrypt cert via ACME challenge.

Update SDK

Pass the new endpoint as baseUrl in the config:

// @layers/client (web / Node)
new LayersClient({
  apiKey: 'unused',
  appId: 'app_xxx',
  environment: 'production',
  baseUrl: 'https://events.yourdomain.com',
});

// @layers/react-native
await Layers.init({
  apiKey: 'unused',
  appId: 'app_xxx',
  environment: 'production',
  baseUrl: 'https://events.yourdomain.com',
});

Verification

  • DNS propagation: 5 min – 24h.
  • Cert provisioning: <5 min after DNS verifies.
  • Status visible in Project → Layers → Layers SDK → Custom domain panel.

Multiple custom domains

You can set multiple per project (e.g., events.app.com for the app, events.web.com for the website). Both CNAME to the same edge endpoint.

Removing

Click Remove in the panel. After removal:

  • DNS record can be deleted at your provider.
  • Existing SDKs configured for that endpoint will fail until reconfigured.

Cert renewal

Automatic via ACME. No action needed.

Privacy benefits

Beyond ad-blocker bypass, custom domains keep all event traffic visibly "yours" — useful for privacy-sensitive audiences who scrutinize what domains your app talks to.

On this page