# Webflow

The **FlarePanel for Webflow** app adds the tracking script to a Webflow site through Webflow's API. You sign in with Webflow, pick a site and paste your client ID.

:::warning
Webflow runs site-wide custom code only on sites with a paid **site plan**. On a free site, neither the app nor the snippet below can add tracking.
:::

## With the app

:::info
The app is in review for the Webflow Marketplace. Until it is listed, use [the snippet](/integrations/webflow#without-the-app) below; it does the same thing.
:::

1. In FlarePanel, open your project's **Settings → Clients** and copy the client ID. No account yet? [Start a 30-day trial](https\://dashboard.flarepanel.dev/onboarding), no card needed.
2. Open the app and select **Connect Webflow**. Allow access to the site you want to track.
3. Pick the site, paste the client ID and select **Install**.
4. **Publish** the site in Webflow. Tracking starts on the published site.

The app asks Webflow to read your sites and manage their custom code. It only adds or removes its own script and leaves any other custom code in place. It does not keep your Webflow access\: the sign-in is stored encrypted in your browser and expires after an hour.

To remove tracking, open the site in the app, select **Remove FlarePanel**, then publish again.

## Without the app

1. In Webflow, open **Site settings → Custom code**.
2. Paste this into **Head code**, with your client ID\:

```html
<script>
  window.op=window.op||function(){var n=[];return new Proxy(function(){arguments.length&&n.push([].slice.call(arguments))},{get:function(t,r){return"q"===r?n:"call"===r||"apply"===r||"bind"===r?t[r]:function(){n.push([r].concat([].slice.call(arguments)))}},has:function(t,r){return"q"===r}})}();
  window.op('init', {
    clientId: 'YOUR_CLIENT_ID',
    trackScreenViews: true,
    trackOutgoingLinks: true,
    trackAttributes: true,
  });
</script>
<script src="https://flarepanel.dev/op1.js" defer async></script>
```

3. Save and publish the site.

## Self-hosted FlarePanel

In the app, open **Self-hosted FlarePanel** and set your API URL and the URL of your `op1.js`. With the snippet, add `apiUrl: 'https://api.example.com'` to the init options and change the script `src`.

## Track clicks without code

In the Designer, select an element, open **Element settings → Custom attributes** and add `data-track` with the event name, for example `signup_click`. Every click on it becomes an event. See [Events and properties](/tracking/events).
