> ## Documentation Index
> Fetch the complete documentation index at: https://help.scribe-mail.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Conversion tracking

> Track website signups, demos, and purchases with the Scribe JavaScript SDK and attribute every conversion back to the email signature that drove it.

Conversion tracking closes the loop on your email signatures. Signature analytics already shows you views and clicks. With the Scribe JavaScript SDK, you can also record what happens next on your own website, the signups, demos booked, and purchases, and tie each one back to the signature, teammate, and link that drove it. This is the bottom of the funnel: views, then clicks, then conversions.

In Scribe these conversions are called **events**. You record them with a few lines of JavaScript, and Scribe attributes them automatically using the same click tracking that powers the rest of your analytics.

<Note>
  Conversion tracking is available on paid plans. If your workspace plan does not include it, the tracking snippet records nothing.
</Note>

## How it works \[#how-it-works]

1. A recipient clicks a link in one of your email signatures.
2. Scribe redirects them to your site and adds a `scribe_click_id` parameter to the destination URL.
3. The Scribe SDK on your landing page reads that `scribe_click_id`, stores it first-party, and attaches it to every event you record.
4. When the visitor converts, you call `scribe.track('signup')`. Scribe joins the event back to the originating click.

The result: you can see which signatures, teammates, and clicked elements produce real conversions and revenue, not just clicks. Attribution works at the sender, signature, and element level, and Scribe matches a conversion to a click for up to 30 days after the click.

If an event arrives without a known `scribe_click_id` (direct traffic, an expired link, or a stripped parameter), it is still recorded. It just is not attributed to a click.

## Before you start \[#before-you-start]

You need three things:

* **A paid plan** that includes conversion tracking.
* **Tracking enabled** for your workspace. This is the same setting that powers signature view and click analytics. Turn it on only once you have the consent you need (see [Privacy and consent](#privacy-and-consent)).
* **Your Event Tracking ID.** This is a public, non-secret identifier for your workspace. It is safe to embed in your website HTML.

<Steps>
  <Step title="Copy your Event Tracking ID">
    In Scribe, open **Settings**, go to the **Workspace** tab, and copy the value under **Event Tracking ID**. While you are there, make sure **Tracking** is enabled.
  </Step>

  <Step title="Add the SDK to your site">
    Use the script snippet for a plain website, or the npm package for an app or single-page app. Both expose the same `scribe.track(...)` API.

    **Option A. Script snippet.** Add this to every page you want to track, right before the closing `</head>` tag. The snippet auto-initializes from `data-workspace`, so there is no `init()` call to make.

    ```html theme={null}
    <!-- Scribe conversion tracking -->
    <script src="https://cdn-1.scribe-mail.com/v1/tracking.js"
            data-workspace="YOUR_EVENT_TRACKING_ID" async></script>
    ```

    **Option B. npm or yarn.** Install the package, then initialize it once at app startup.

    ```bash theme={null}
    npm install @scribemail/js
    # or: yarn add @scribemail/js
    ```

    ```js theme={null}
    import scribe from '@scribemail/js';

    scribe.init({ id: 'YOUR_EVENT_TRACKING_ID' }); // once, at app startup
    ```

    Importing the module has no side effects (it is safe for server-side rendering). Nothing is sent until you call `init()`.
  </Step>

  <Step title="Record your first conversion">
    Call `scribe.track` wherever a conversion happens, for example in your signup success handler.

    ```js theme={null}
    scribe.track('signup', { value: 99.0, currency: 'USD', plan: 'pro' });
    ```

    The SDK captures the Scribe click attribution from the landing URL for you, batches your events, and sends them reliably, including when the visitor navigates away.
  </Step>

  <Step title="Check that it works">
    Trigger the event on your site, then open **Analytics** in Scribe. Your conversions appear alongside views and clicks, broken down by signature, teammate, campaign, and country.
  </Step>
</Steps>

## SDK reference \[#sdk-reference]

### `scribe.track(name, metadata)`

Records an event. `name` is required, for example `signup`, `demo_booked`, or `purchase`.

```js theme={null}
scribe.track('purchase', {
  value: 149.0,           // optional, monetary value of the conversion
  currency: 'EUR',        // optional, ISO currency code
  event_id: 'order_8821', // optional, your own id, used for idempotency
  plan: 'team',           // any other key becomes an event "property"
  seats: 5
});
```

* `value`, `currency`, and `event_id` are recognized top-level fields.
* **Every other key** becomes part of the event's `properties`. Keep properties to flat scalar values (strings, numbers, booleans). Do not put personal data such as emails or phone numbers in properties: Scribe drops keys that look like personal data automatically.
* Provide your own `event_id` to make a send safe to retry. The same `event_id` received twice within 24 hours is recorded only once.

### `scribe.identify(userId, traits)`

Associates the visitor with one of your own users, so you can see which signatures acquire which customers. Useful for B2B and account-based work.

```js theme={null}
scribe.identify('user_42', { email: 'ada@example.com', name: 'Ada', plan: 'pro' });
```

After an `identify` call, subsequent `track` calls are tied to that user. Call `scribe.reset()` on logout to clear the identity.

### `scribe.flush()`

Events are batched and sent automatically, and always on page hide. Call `flush()` only if you need to force the current batch out immediately.

### Snippet attributes

When you use the script snippet, configure it with `data-*` attributes:

| Attribute            | Required | Description                                                                  |
| -------------------- | -------- | ---------------------------------------------------------------------------- |
| `data-workspace`     | Yes      | Your Event Tracking ID.                                                      |
| `data-consent`       | No       | Set to `"denied"` to disable first-party storage until the visitor consents. |
| `data-cookie-domain` | No       | Set your apex domain to share identity across subdomains.                    |

### Content Security Policy

If your site sets a Content Security Policy, allowlist the Scribe hosts:

```
script-src  https://cdn-1.scribe-mail.com;
connect-src https://t.scribe-mail.com;
```

<Tip>
  Need to record an authoritative event from your backend, such as a payment your server confirmed? Scribe also accepts events through the API with an `events:write` API key, which keeps revenue values trusted rather than client-supplied. See the [API Reference](/api-reference/introduction) for details.
</Tip>

## Use cases: turn conversions into growth \[#use-cases]

Conversion tracking turns your email signatures into a measurable acquisition channel. Here is how teams put the data to work, including feeding it into paid remarketing.

### Run remarketing campaigns on Google Ads and Meta Ads

Fire your ad-platform conversion pixels in the same place you call `scribe.track`, so a single conversion lands in Scribe, Google Ads, and Meta at once. Scribe tells you the conversion came from an email signature; Google and Meta use the same signal for bidding and audiences.

```js theme={null}
function onSignupComplete(plan, price) {
  // 1. Attribute the conversion to the email signature that drove it
  scribe.track('signup', { value: price, currency: 'USD', plan });

  // 2. Send the same conversion to your ad platforms for bidding and audiences
  // gtag('event', 'conversion', { send_to: 'AW-XXXXXXXXX/abc', value: price, currency: 'USD' });
  // fbq('track', 'CompleteRegistration', { value: price, currency: 'USD' });
}
```

### Build high-intent retargeting audiences

People who clicked your signature and landed on your site, but did not convert, are warm. Use Scribe to confirm signature-driven traffic, then retarget those visitors with a tailored offer on Google and Meta. Because the traffic comes from your own emails, these audiences tend to convert better than cold prospecting.

### Seed lookalike and similar audiences from your converters

Your best seed audience is people who already converted through a trusted channel. Pull the visitors that signatures acquired (filter by signature, teammate, or campaign), upload them as a Custom Audience in Meta or a Customer Match list in Google Ads, and build Lookalike or Similar audiences from that high-quality seed.

### Suppress existing customers from acquisition spend

Stop paying to acquire people who already signed up or bought. Export your converters and add them as an exclusion or suppression list on your prospecting campaigns, so budget goes to net-new prospects.

### Optimize for revenue, not just clicks

Pass a real `value` and `currency` with each conversion. With revenue attached, you can switch Google and Meta to value-based bidding, and in Scribe you can rank signatures, teammates, and campaigns by the revenue they generate rather than by clicks alone.

### Prove the channel and reallocate budget

Conversion tracking lets you compare email-signature-driven revenue against your paid channels in the same terms. When a signature campaign outperforms a paid one, you have the numbers to shift budget toward what works.

## Ask an AI agent to set it up \[#ai-agents]

You do not have to wire this up by hand. If you use an AI coding assistant (such as Claude Code, Cursor, or a similar agent in your editor), paste it a prompt like this, with your own Event Tracking ID and the conversions you care about:

```text theme={null}
Install the Scribe conversion tracking SDK on my website.

- If this is an app or single-page app, add the @scribemail/js package and call
  scribe.init({ id: 'YOUR_EVENT_TRACKING_ID' }) once at startup. If it is a plain
  HTML site, add the https://cdn-1.scribe-mail.com/v1/tracking.js script with
  data-workspace="YOUR_EVENT_TRACKING_ID" before </head> instead.
- Call scribe.track('signup', { value, currency }) from my signup success handler
  and scribe.track('purchase', { value, currency }) from my checkout confirmation.
- If I have logged-in users, call scribe.identify(userId, { email, plan }) after login.
- Add https://cdn-1.scribe-mail.com and https://t.scribe-mail.com to my Content
  Security Policy if I have one.
```

Once conversions are flowing, an agent connected to the [Scribe MCP server](/en/ai-agents/connect) can read and explain the results for you. Ask it things like "which signatures and teammates drove the most conversions and revenue this month?" or "list the visitors my signatures acquired this week." See [Scribe for AI agents](/en/ai-agents) and the [Scribe analytics skill](/en/ai-agents/skills) for what your assistant can pull.

## Privacy and consent \[#privacy-and-consent]

Conversion tracking is built to respect your visitors and your obligations:

* **IP addresses are anonymized.** Scribe hashes the IP before storing it. Raw IPs are never kept.
* **No personal data in properties.** Keys that look like personal data (email, phone, password, tokens, card numbers, and similar) are stripped from event properties automatically. Use `identify` when you deliberately want to associate a user.
* **Consent-gated storage.** Set `data-consent="denied"` (snippet) or `consent: false` (npm `init`) to keep the SDK from storing the click identifier until your visitor consents.
* **Get consent before enabling tracking.** The workspace tracking setting carries the same responsibility as any analytics pixel. Make sure you have the consent your region requires before you turn it on.

## Related articles

* [Analytics Overview](/en/analytics-overview): views, clicks, reach, and CTR across your workspace.
* [Analytics Dashboard](/en/analytics-dashboard): read conversions next to views and clicks in every tab.
* [Signature analytics](/en/signature-analytics): performance for an individual signature.
* [Marketing campaigns](/en/marketing-overview): run and measure banner campaigns inside signatures.
* [Scribe for AI agents](/en/ai-agents): let an assistant set up tracking and report on conversions.
