Sign up

Proxy

Managed proxy

On this page

Route MetricRaven through a subdomain of your website without running any proxy code. You add one DNS record; MetricRaven serves the script and receives events there, with its own TLS certificate.

Recommended for most sites. Use the managed proxy unless your app already proxies requests through its own server. To compare both options, see Serve tracking from your own domain.

Why use a proxy?

Ad blockers often block known analytics domains. A subdomain of your own website is blocked less often, so you see more of your visits and more of your revenue attribution. You don't need a proxy to start; add one before a launch or when you want more complete data.

Without a proxy, the script and its events go to metricraven.com. With the managed proxy they go to your subdomain instead, for example a.example.com/js/script.js and a.example.com/api/v1/collect.

Set it up

  1. Enable the managed proxy

    • Open Settings → Tracking & install → Managed proxy on your website's dashboard.
    • Enter a subdomain of your website, such as a.example.com, and select Enable.

    Pick a short, neutral name such as a or cdn. Blocklists often target names like analytics, tracking, stats or metrics. Use a subdomain, not your main site's hostname. Admins and the owner can set it up; each website has one managed proxy.

  2. Add the DNS record

    The dashboard shows the exact record. For a subdomain it's one CNAME:

    DNS fieldValue
    TypeCNAME
    Name / Hosta
    Target / Valueproxy.metricraven.com
    TTLAuto (or 300 seconds)
    Proxy statusDNS only, proxy off (Cloudflare: grey cloud)

    The dashboard looks up where your domain's DNS is hosted and, for the providers below, shows that provider's steps, its own field names, a link to its DNS page and a copy button for each field.

    a is only an example: for cdn.example.com the name is cdn. If the dashboard also shows a TXT record, add it only when the status stays on Waiting for DNS for more than 10 minutes. You can delete the TXT record once the proxy is active.

    DNS changes usually show up within 1–10 minutes. MetricRaven checks automatically (every minute at first) and issues the certificate as soon as the record is in place. Select Check again to look right away.

  3. Update your script tag

    When the status is Active, replace your MetricRaven tag with this one. The Install card in Settings shows it with your site ID filled in.

    Your website's shared layout
    <script defer src="https://a.example.com/js/script.js" data-site-id="YOUR_SITE_ID"></script>

    The tracker sends its events to the host it was loaded from, so there's no separate events URL to set. If your tag has a data-api attribute from a self-hosted proxy, remove it.

Steps by DNS provider

Add the record where your domain's DNS is hosted, which isn't always where you bought the domain. The dashboard detects it from your domain's nameservers. Field names differ by provider:

ProviderWhereName fieldTarget fieldTTLProxy / forwarding
CloudflareDNS → Records → Add recordNameTargetAutoDNS only (grey cloud)
Amazon Route 53Hosted zones → your domain → Create recordRecord nameValue300Alias off
Google Cloud DNSCloud DNS → your zone → Add standardDNS nameCanonical name300Off
GoDaddyDomain Portfolio → your domain → DNS → Add New RecordNameValue1/2 HourDNS record, not forwarding
NamecheapDomain List → Manage → Advanced DNS → Add New RecordHostValueAutomaticCNAME Record, not URL Redirect
SquarespaceDomains → your domain → DNS → DNS settings → Custom recordsHostDataDefaultCustom record, not forwarding
IONOSDomains & SSL → your domain → DNS → Add recordHost namePoints to1 hourDNS record, not forwarding
VercelDomains → your domain → DNS RecordsNameValue60Off
NetlifyDomains → your domain → DNS records → Add new recordNameValue3600Off
DigitalOceanNetworking → Domains → your domain → CNAMEHostnameIs an alias of300Off
HetznerHetzner Console → project → DNS → your zoneNameValueDefaultOff

Any other provider works the same way: add a CNAME with the name and target from the dashboard, keep the default TTL, and keep any proxy, CDN, forwarding or redirect option off for this record.

On Cloudflare, set Proxy status to DNS only (grey cloud). With the orange cloud (Proxied), requests go through your own Cloudflare zone first and don't reach the MetricRaven proxy, so the status stays on Waiting for DNS or the subdomain returns errors. Turning the cloud grey fixes it within a few minutes; select Check again.

Why it matters: the record has to point straight at proxy.metricraven.com. The certificate for your subdomain is issued only once the name resolves there, and that's how requests to your subdomain reach MetricRaven.

Statuses

StatusMeaning
Waiting for DNSThe CNAME record isn't visible yet. The dashboard shows the last check's result.
Issuing certificateDNS is correct and the TLS certificate is being issued, usually within a few minutes.
ActiveThe subdomain serves the script and receives events. Switch your tag now.
Needs attentionSomething broke, for example the CNAME was removed or never appeared. The dashboard says what to fix.

If no record appears within 7 days, MetricRaven stops checking and the status becomes Needs attention. Add the record and select Check again to start over. Active proxies are rechecked every few hours.

Verify it works

  • Open your live website, not the proxy subdomain itself (its root page is a 404 on purpose).
  • In the browser's Network panel, script.js loads from your subdomain and events go to https://a.example.com/api/v1/collect with ok: true.
  • Your visit appears in the realtime view.

Troubleshooting

ProblemWhat to check
Status stays on Waiting for DNSThe CNAME matches the dashboard exactly; it's a DNS record, not a redirect or forwarding rule; your DNS provider's proxy mode (such as Cloudflare's orange cloud) is off for this record. Then wait a few minutes and select Check again.
Needs attentionRe-check the record's type, name and target. Make sure you're editing the DNS zone of your website's domain. Add the TXT record if the dashboard shows one.
Still blocked or not loadingAvoid obvious names (analytics, tracking, stats, metrics). The script src uses https:// and your subdomain, not metricraven.com.
Content Security Policy errorsAllow your proxy subdomain in script-src and connect-src.
Events refused with domain_not_allowedThe page sending them isn't one of your website's domains. The proxy subdomain doesn't need to be listed; the pages that load the script do.

Remove the managed proxy

First point your script tag back at https://metricraven.com/js/script.js. Then, in Settings → Tracking & install → Managed proxy, select Remove; the subdomain stops serving the script at once. Finally delete the DNS record.

API, CLI and MCP

With an account token and ?site= (changes need the write scope and an admin or the owner):

RequestWhat it does
GET /api/v1/managed-proxyHostname, status, error, the DNS records to add and the script tag.
POST /api/v1/managed-proxy { "hostname": "a.example.com" }Sets it up (201). 409 if the website already has one or the hostname is taken.
POST /api/v1/managed-proxy/checkLooks for the DNS record now.
GET /api/v1/managed-proxy/dns-providerWhere the subdomain's DNS is hosted: zone, nameservers and provider (or null).
DELETE /api/v1/managed-proxyRemoves it.

CLI: metricraven proxy status, proxy enable a.example.com, proxy check and proxy remove. MCP: get_managed_proxy.

Managed or self-hosted?

Managed proxySelf-hosted proxy
Best forMost sitesApps that already proxy requests through their own server
Code requiredNoYes
DNSOne CNAMENone
TLS certificateHandled by MetricRavenYour host's
Script tagsrc on your subdomainsrc and data-api on your own paths
MaintenanceHandled by MetricRavenYours

For self-hosted setups, see the proxy recipes.

Details

  • The subdomain answers only the script and the events endpoint. Every other path is a 404.
  • Only your website can send events through its subdomain, and events are still checked against your website's domains, as without a proxy.
  • Visitor locations and per-visitor rate limits work as without a proxy: the visitor's IP is passed along.
  • The script is cached for up to an hour, so tracker updates reach your subdomain within the hour.
  • A proxy doesn't guarantee that every blocker will allow tracking.