All docsSearch docs

Start

  1. 01Getting started
  2. 02Install
  3. 03Tracking

Features

  1. 04The dashboard
  2. 05Goals
  3. 06Short links
  4. 07AI sources and agents
  5. 08Email reports
  6. 09Scheduled check
  7. 10Ask your AI

Reference

  1. 11Performance
  2. 12Configuration
  3. 13HTTP API

Platforms

  1. 14Standalone server
  2. 15ClickHouse
  3. 16PHP
  4. 17WordPress
  5. 18Drupal
  6. 19Craft CMS
  7. 20Webflow
  8. 21Python
  9. 22Rails
  10. 23Ruby
  11. 24Go
  12. 25Java
  13. 26.NET
  14. 27Elixir
  15. 28Rust

Trust

  1. 29Privacy

Platforms

Webflow

Count the visitors to a Webflow site with Runlight, using the standalone server and one script tag.

Webflow hosts your site for you, so Runlight cannot run inside it the way it runs inside WordPress, Drupal, or Craft. A Webflow site sends its visits to a standalone server you run elsewhere instead, and you add the server’s script tag in Webflow’s settings. The server can count any number of Webflow sites, and other sites too, in one dashboard.

Webflow adds custom code only on sites with a paid site plan or Workspace plan.

Set it up

Start the standalone server and put it on the internet at an address of its own, such as https://stats.example.com. Sign in, add your Webflow site’s domain, such as example.com, and copy the script tag the next screen gives you.

html

<script defer src="https://stats.example.com/s.js?site=example.com" data-site="example.com"></script>

In Webflow, open the site’s Site settings, then Custom code. Paste the script tag into Head code and save. Then publish the site, since Webflow adds custom code only to published pages and never to the Designer’s canvas.

Open your site in a new browser tab, then click here now under the site’s name in the dashboard, and your visit shows within a few seconds.

Your webflow.io address

Runlight counts only the domains you list for the site, so visits to the staging address that Webflow gives every site, such as example.webflow.io, are left out. That keeps your own checks of unpublished work out of the numbers. To count the staging address as well, add it to the site’s domains in Settings, General.

Where to run the server

Some ad blockers block scripts from analytics services they know. A server on a subdomain of your own site, such as stats.example.com, is less likely to be blocked than one on an address shared by many sites, and it keeps every request on your own domain.

Webflow cannot pass requests on to another server, so the script tag always points at the server’s own address.

Goals and events

The script records pageviews, outbound link clicks, and file downloads by itself. Click goals need no code at all, since Pick on my site opens your published Webflow site and lets you click the button or link to count.

To name an event in Webflow, select the element in the Designer, open Element settings, and add a custom attribute named data-runlight with the event’s name as its value, such as Signup. Other attributes that start with data-runlight- become the event’s properties, as described in Clicks with no JavaScript.

A click on a form’s submit button counts the click, which happens even when the form is not sent. To count only forms that Webflow accepted, add this to Footer code in Site settings, Custom code, after the script tag. It records an event named Form sent, with the form’s name as a property, each time Webflow shows a form’s success message.

html

<script>
  window.runlight = window.runlight || function () { (window.runlight.q = window.runlight.q || []).push(arguments); };
  document.querySelectorAll(".w-form").forEach(function (box) {
    var done = box.querySelector(".w-form-done");
    var form = box.querySelector("form");
    if (!done || !form) return;
    new MutationObserver(function (changes, watcher) {
      if (getComputedStyle(done).display === "none") return;
      watcher.disconnect();
      runlight("Form sent", { form: form.getAttribute("data-name") || form.id || "Form" });
    }).observe(done, { attributes: true, attributeFilter: ["style"] });
  });
</script>

Make Form sent a goal in the dashboard to see how many visits end with a sent form.

Leaving yourself out

The dashboard is on a different domain from your Webflow site, so open any page of the site with ?runlight=ignore in each browser you use, and that browser’s visits are no longer counted for a year from the last time it opened such a link. ?runlight=track undoes it. People who edit the site in Webflow’s Editor see the published pages, so they need the same step.

What it cannot see

AI agents such as GPTBot and ClaudeBot read pages without running JavaScript, so the script tag never sees them. Runlight counts them where a page is served or from a web server’s access log, and Webflow shares neither, so a Webflow site’s AI agents box stays empty. Visits from people who clicked a link in an answer from ChatGPT, Claude, or another assistant still count, under the AI channel.