# Install on Webflow

> Add Reveata to a Webflow site, serve it from your own subdomain, and count clicks on Webflow buttons and links as goals.

Webflow adds code to the `<head>` of every page from the site settings. Site-wide custom code needs a paid Site plan or a paid Workspace plan; the free Starter plan can't add it.

Copy the snippet from your Reveata dashboard (it contains your website’s tracking id):

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

## Add it to your site

1. Open your site’s **Site settings** and choose the **Custom code** tab.
2. Paste the snippet into **Head code**. The field takes up to 50,000 characters, so it fits next to other code you already have.
3. Select **Save changes**.
4. **Publish** the whole site. Custom code only runs on the published site, and publishing a single page doesn’t publish site-level code.

In Reveata, add the website with your custom domain. Your `.webflow.io` staging address is another host: visits there are refused unless you add it under **Settings → General → Additional domains**. Leaving it out keeps your own testing out of your numbers.

Webflow pages are full page loads, so every page is counted with no extra setup.

## Serve it from your own subdomain

Webflow can’t run proxy code, but the [managed proxy](https://reveata.com/docs/managed-proxy) needs none: you add one DNS record (for example `stats.example.com`) where your domain’s DNS is managed, and Reveata gives you a new snippet to paste into **Head code** instead. Fewer visits are lost to ad blockers. It works with a custom domain, not with the `.webflow.io` address.

## Revenue

**Webflow Ecommerce.** Webflow takes payments through the Stripe (or PayPal) account you connected in **Settings → Ecommerce → Payments**. Connect the same Stripe account in Reveata under **Settings → Payments** with a [restricted key](https://reveata.com/docs/stripe-restricted-key) or [Connect with Stripe](https://reveata.com/docs/stripe-connect). Orders then count as revenue. Webflow creates its own Stripe payments, so they carry no visitor id: they are credited to a visit by the buyer’s email, for visitors you identified (see below). PayPal payments are not in Stripe and are not imported.

**Stripe Payment Links and Buy Buttons.** Many Webflow sites link to a hosted checkout. Those links are credited to their visit with no code: the script adds the visitor id when someone clicks. See [Stripe Payment Links and buy buttons](https://reveata.com/docs/stripe-payment-links).


**Identify buyers by email.** Add this to **Footer code** to identify people when they submit a Webflow form with an email field:

```html
<script>
  document.addEventListener('submit', function (e) {
    var input = e.target.querySelector('input[type="email"]');
    var email = input && input.value.trim().toLowerCase();
    if (email && window.reveata) window.reveata('identify', { userId: email, email: email });
  });
</script>
```

A later Stripe payment with the same email is then credited to that visitor’s visits. Only identify people when your privacy policy covers it: see [Identify visitors](https://reveata.com/docs/identify-visitors).

## Check it works

1. Open your published site in a normal browser window with ad blockers turned off for it.
2. Open **Realtime** in Reveata: your visit appears within a few seconds.
3. If it doesn’t, view the page source of the published site and search for `data-website-id`, then follow [Verify your installation](https://reveata.com/docs/verify-your-installation).

## Goals

To count clicks as goals, select the button or link in the Designer, open the **Element settings** panel, and under **Custom attributes** add the name `data-reveata-goal` with a value such as `signup`. Publish again. See [Custom goals](https://reveata.com/docs/custom-goals).

## Common pitfalls

- **Not published.** Saving custom code is not enough: publish the whole site.
- **Testing in the Designer or preview.** Preview doesn’t run custom code by default, and the Designer never does. Test the published site.
- **Testing on `.webflow.io`.** It is refused unless it is one of the website’s additional domains, and the install check says so.
- **A cookie consent tool.** If your consent tool holds back scripts until people accept, visits only count after they do. [Cookieless mode](https://reveata.com/docs/privacy-and-cookies) (`data-cookieless="true"`) needs no cookies at all.
- **Two copies.** If the snippet is both in **Head code** and in a page’s own custom code, the second copy is ignored, but remove it to keep things clear.
