---
title: The Rebilder Tag
description: Count AI-referred visits, signups, demo requests and leads on your website with the Rebilder Tag. Connect the script and mark each goal with one line.
canonical_url: https://rebilder.com/docs/tag
last_updated: "2026-11-28"
---

# [The Rebilder Tag](https://rebilder.com/docs/tag)

> Count AI-referred visits, signups, demo requests and leads on your website with the Rebilder Tag. Connect the script and mark each goal with one line.

- **Updated:** 2026-11-28
- **Author:** Rebilder
- **Section:** Concepts
- **Description:** Count AI-referred visits, signups, demo requests and leads on your website with the Rebilder Tag. Connect the script and mark each goal with one line.
- **Publisher:** Rebilder

## The whole install

The Rebilder Tag is a first-party script you paste into your own site. It is dependency-free, it is served from rebilder.com, and the install is complete when this one line is in your HTML:

Anywhere in your page HTML

```text
<script defer src="https://rebilder.com/tag.js" data-rebilder-store="STORE_ID"></script>
```

Replace `STORE_ID` with the store id shown on [Console install](/console/install). The tag works on any platform that lets you add a script tag; there is no build step and no package to keep current.

The tag records browser activity. Add the [gateway](/docs/quickstart) for source-backed serving and server-side request reporting. Both feed the Console.

## What it reports

One beacon per initial pageview, sent with `navigator.sendBeacon` to the endpoint below, and nothing else. The payload is three fields:

| Field | What it carries |
| --- | --- |
| `path` | `location.pathname` only. A query string never leaves the page, and the stored column refuses a value containing `?`. |
| `ref` | The referrer, only when it comes from another origin. A same-origin referrer is dropped at the endpoint and never stored. |
| `wd` | `navigator.webdriver`, verbatim. `true` means an automated browser declared itself; `false` or absent means nothing. |

The server supplies the timestamp from its own clock, because the tag sends none, and classifies the cross-origin referrer into a platform (`chatgpt`, `perplexity` and the rest) with the same classifier the gateway events path uses. A route change in a single-page app does not fire another beacon; the count is initial pageviews.

## Mark signups, demo requests and leads

A goal records that a visitor did the thing you want: finished a signup, requested a demo, or sent a lead form. The Console counts goals per kind in the [Funnel](/console/funnel), next to orders, and ranks the gaps on pages that convert AI-referred visitors first. Add this line once, before the tag, so a goal called early waits instead of failing:

Once per page, before the tag

```text
<script>window.rebilder = window.rebilder || function () { (rebilder.q = rebilder.q || []).push(arguments) }</script>
```

Then call it where the conversion happens, for example after your signup form reports success:

One line per goal

```ts
rebilder('goal', 'signup')
rebilder('goal', 'demo', { value_cents: 15000, currency: 'USD' })
rebilder('goal', 'lead')
rebilder('goal', 'custom:webinar-registration')
```

| Argument | What it takes |
| --- | --- |
| kind | `signup`, `demo`, `lead`, or your own goal as `custom:` plus a lowercase name of letters, digits and hyphens, such as `custom:webinar-registration`. |
| `value_cents` | Optional. What the goal is worth to you, as a non-negative whole number of minor units. Stored as sent and never converted. |
| `currency` | Optional, with `value_cents`. Three letters; `USD` when absent. |

The goal beacon goes to the same address as the pageview and carries the same page fields (`path`, `ref`, `wd`) plus `goal` and the value you passed. Each kind is sent at most once per page load, so a double click or a re-rendered success screen counts once.

- **No personal data.** The tag reads `value_cents` and `currency` from the options and nothing else, so an email, name or form field you pass stays in the page. The endpoint refuses a goal beacon that carries any other field.
- **Consent follows the tag.** A goal is sent only by a tag that has loaded and passed the checks above. If your site asks visitors before measuring them, load the tag through your consent tool as you do other measurement; goals called before then wait in the line above and are sent once it loads, or never.
- **Automated browsers record no goal.** A goal from a browser that declares `navigator.webdriver` is dropped.
- **Sending from your server instead.** Use [POST /v1/goals](/docs/outcomes#goals-api) with an idempotency key. Send each goal from one place: the browser and the server are de-duplicated separately.

## How a goal is linked to an AI assistant

Each goal is classified once, when it is recorded, and the rule that matched is stored with it. The rules are the ones orders use:

| Funnel label | Rule |
| --- | --- |
| Same visit | The page the goal fired on was opened from an AI assistant: its referrer, the one the pageview reports, is a recognised assistant such as ChatGPT or Perplexity. |
| Within 7 days (inferred) | No referral on that page load, but an AI assistant requested that exact page in the 7 days before the goal, as recorded by your [gateway](/docs/quickstart). This is an inference and the Console labels it as one. |
| No link | Neither rule matched. The goal still counts toward its kind. |

By default, the tag holds no visitor identifier and uses no browser storage, so a goal matches the same visit on the landing page itself or in a single-page app that never reloads. For multi-page signup flows without cookies, you can opt in by adding `data-rebilder-session-ref="1"` to the `<script>` tag: the tag then stores only the external landing referrer origin in tab-scoped `sessionStorage` and attaches it to goal beacons in that tab, or you can send the goal from your server with the pages of the visit in `page_urls`.

## What it deliberately does not collect

> **Data excluded from reporting** The tag reports the fields documented below. It excludes form contents and personal identifiers from event payloads.

- **No query strings, ever.** The beacon sends `location.pathname` only, the endpoint strips any query that reaches it anyway, and the database refuses a path that carries one. Search terms, tokens and tracking parameters never reach the table.
- Pageview records exclude IP addresses. The endpoint uses separate, temporary rate-limit records; see the Privacy Policy for processing details.
- **No raw User-Agent.** The endpoint classifies server-side, and only the classification lands.
- **No cookies, no storage, no identifiers, no fingerprinting.** By default, the tag stores nothing in the browser and reads nothing beyond the three fields above and, for a goal, the two goal options. Opting in with `data-rebilder-session-ref="1"` keeps only the external landing referrer origin in tab-scoped `sessionStorage` for multi-page goal attribution, without cookies or visitor identifiers. Rows are pageviews, not people, so any visitor count derived from them is an estimate and is labelled as one wherever it renders.
- **Honors Do Not Track and Global Privacy Control.** When `navigator.doNotTrack` is `1` or `globalPrivacyControl` is set, the tag sends nothing at all, goals included.
- The Rebilder Tag measures activity on the website where you install it. See the Privacy Policy for analytics used on rebilder.com.
- Tag events are sent to `https://api.rebilder.com/v1/client-events`.

## Reporting coverage

The tag sees traffic that executes JavaScript in a browser: human visitors, including the ones AI assistants refer, and browser-driving agents that declare themselves through `navigator.webdriver`. It also gives WordPress-sourced and self-hosted stores the human-pageview denominator their agent numbers were missing.

> **Direct HTTP request coverage** Direct HTTP requests do not execute the tag. Use server-side reporting for those requests and tag data for supported browser activity. The Console keeps these measurements distinct.

Read the two instruments together: the tag carries the human-pageview denominator and the AI-referred half, and the gateway carries agent fetches, the answer rate and the miss log.