# Managed proxy

> Serve the Reveata script from your own subdomain with one DNS record, so ad blockers miss fewer visits.

Some ad blockers and browser privacy settings block analytics scripts that load from another company's address. With the managed proxy, the script and the visits it sends go through a subdomain of your own site, for example `stats.example.com`. To the browser it is part of your site, so fewer visits go missing.

You add one DNS record. Reveata checks it, sets up HTTPS for the subdomain on its own and gives you a new snippet. Nothing else on your site changes.

## Before you start

- You need to be an **admin** or the **owner** of the website in Reveata.
- You need access to the place where your domain's DNS is managed. That is usually where you bought the domain (GoDaddy, Namecheap, Squarespace Domains…) or a DNS service such as Cloudflare. If you are not sure, look up your domain on a "who is my DNS provider" site, or ask whoever set up your website.
- Pick a subdomain that is not used yet. `stats`, `data` or `insights` work well. Avoid words like `analytics` or `tracking`, which some blockers look for.

## 1. Choose the subdomain in Reveata

1. Open your website in Reveata, then **Settings → General**.
2. In **Tracking code**, find **Managed proxy**.
3. Type the subdomain (only the first part, for example `stats`) and press **Save and check DNS**.

Reveata now shows the exact record to add, with copy buttons:

| Type  | Name                    | Target                    |
| ----- | ----------------------- | ------------------------- |
| CNAME | your subdomain, `stats` | the target shown for you |

If the panel says managed proxy isn't available, it isn't open for your account yet: write to support, or [proxy through your own server](https://reveata.com/docs/self-hosted-proxy) instead.

## 2. Add the record at your DNS provider

Every provider has a page called something like **DNS**, **DNS records**, **Zone editor** or **Advanced DNS**. Add a new record there:

- **Type:** `CNAME`
- **Name** (also called Host or Alias): your subdomain, for example `stats`. A few providers want the full name, `stats.example.com`. If the page already shows your domain next to the field, type only `stats`.
- **Target** (also called Value, Points to or Alias of): copy it from Reveata exactly. Some providers add a dot at the end on their own; that is fine.
- **TTL:** leave the default (Automatic, or 1 hour).

Steps for common providers:

- **Cloudflare:** DNS → Records → Add record. Type CNAME, Name `stats`, Target from Reveata. Click the orange cloud so it turns grey (**DNS only**). With the orange cloud on, Cloudflare answers for the subdomain itself and Reveata can't verify it or set up HTTPS.
- **GoDaddy:** My Products → your domain → DNS → Add New Record. Type CNAME, Name `stats`, Value from Reveata.
- **Namecheap:** Domain List → Manage → Advanced DNS → Add New Record. Choose CNAME Record, Host `stats`, Value from Reveata.
- **Squarespace Domains:** Domains → your domain → DNS → Custom records → Add record. Type CNAME, Host `stats`, Data from Reveata.
- **Google Cloud DNS, AWS Route 53 and others:** create a CNAME record named `stats.example.com` (the full name) with the target from Reveata.
- **Wix, Webflow** and other site builders that manage your domain: open the domain's DNS settings in the builder and add a CNAME record as above.

Save the record. You can't add a CNAME on a name that already has another record (for example an A record): pick a different subdomain, or delete the old record first if nothing uses it.

## 3. Wait for the check

DNS changes usually show within minutes, sometimes up to an hour. Press **Check now** in Reveata whenever you like. On its own, Reveata checks every 10 minutes for 3 days.

The status next to the buttons tells you where you are:

- **Waiting for DNS:** Reveata can't see the record yet, or it points somewhere else. The line below says what it found.
- **Checking DNS:** a check is running.
- **Verified on (date):** everything works.
- **Failed:** the record was not found within 3 days, or it stopped pointing to Reveata for 3 days. Fix the record and press **Check now**.

## 4. Update the snippet on your site

Once the proxy is verified, the **Tracking code** in Settings changes to load from your subdomain:

```html
<script defer data-website-id="ws_your_tracking_id" src="https://stats.example.com/js/script.js"></script>
```

Replace the snippet on your site with the new one. The script sends visits to the same subdomain, so you don't need to set `data-api`. With the `@reveata/next` or `@reveata/tracker` packages, set `host` to `https://stats.example.com`.

The first visit to the new address can take a few seconds longer while HTTPS is set up for it.

### With Google Tag Manager

Tag Manager only lets a template load scripts from the addresses in its **Injects scripts** permission. Once the proxy is verified, Settings shows a link to the tag template for your website. Its permission also allows `https://*.example.com/js/*` (any subdomain of your website, which is how Tag Manager writes a first-party host pattern). Import it as described in [Install with Google Tag Manager](https://reveata.com/docs/google-tag-manager) and set the tag's **Reveata address** to `https://stats.example.com`.

If you already imported the template, open it in **Templates**, go to **Permissions → Injects scripts**, add `https://*.example.com/js/*` and save. Without it the tag fails instead of loading the script.

## Keep the record

Leave the DNS record in place for as long as you use the snippet. Reveata checks it every day. If it stops pointing to Reveata for 3 days, the proxy is marked failed and the owner of the website gets an email and a notification.

To stop using the proxy, press **Remove** in Settings, put the regular snippet back on your site, and then delete the DNS record.

## Common questions

**Does this change what is collected?** No. The same script runs and the same data is sent. Only the address changes. See [Privacy and cookies](https://reveata.com/docs/privacy-and-cookies).

**My DNS provider doesn't allow a CNAME here.** Some providers flatten CNAME records into address records. That works too: Reveata accepts the record when its addresses are the same as the target's.

**Can I check that it works?** Open `https://stats.example.com/js/script.js` in your browser: you should see the script. Then follow [Verify your installation](https://reveata.com/docs/verify-your-installation).

**Can I use my own server instead?** Yes. Without a DNS record, you can pass the script and events through Next.js, Vercel, Netlify, Cloudflare Workers, Nginx, Caddy, Apache, Express, Laravel or WordPress. See [Proxy through your own server](https://reveata.com/docs/self-hosted-proxy).
