---
updatedAt: 2026-06-04T08:07:26.000Z
agentTools:
  projectIndex: https://developers.rebrandly.com/llms.txt
---

# Getting started with conversion tracking

Install the conversion tracking SDK, verify it's working, and fire your first event.

This guide walks you through adding the conversion tracking SDK to your website or web app. By the end, you will have the script installed, installation verified, and your first conversion event firing.

## Step 1: Generate your conversion tracking key

Your conversion tracking key is generated in Rebrandly. It cannot be created via the API, and other Rebrandly API keys cannot be used for tracking.

In Rebrandly, open **Settings**, navigate to **Conversion tracking**, then click **Step 1 > Create API key**.

> 📘 Your conversion tracking key is intentionally public
>
> This key will be visible in your site's source code as part of the script tag. That is expected and safe. It is not the same as a Rebrandly API key, which must always be kept private.

> 📘 Create one key per site
>
> Create one conversion tracking key for each website or app you instrument. This keeps conversion data clean and makes access management easier if you need to rotate or revoke keys later.

For a full UI walkthrough, see [How do I set up conversion tracking?](https://support.rebrandly.com/en/articles/608891-how-do-i-set-up-conversion-tracking) in the Help Center.

## Step 2: Add the script to your site

Add the following tag to the `<head>` element of your website, replacing `YOUR_KEY` with the key you generated in step 1. The script will also be auto-generated for you after you create the key.

```html
<script src="https://cdn.rebrandly.com/analytics/sdk/v1/rbly.min.js" data-api-key="YOUR_KEY"></script>
```

## Step 3: Verify installation

When the SDK initializes, it writes one of the following messages to the browser console:

* `[Rebrandly SDK] Initialized with click ID: {id}` — an `rbly_click_id` was found and stored
* `[Rebrandly SDK] Initialized (no click ID found)` — the page was not loaded via a branded link

To confirm the SDK is sending events, call `rbly.convert()` and then check the **Network** tab in your browser dev tools for a request to `{apiBase}/v1/track/conversion`.

## Step 4: Fire your first event

`rbly.convert()` is the method for recording conversion events. For monetary conversions, pass value and currency:

```javascript
rbly.convert('purchase', 19.99, 'USD', { orderId: 'ORDER-123' });
```

For non-monetary conversions, pass only a label:

```javascript
rbly.convert('signup');
```

The [custom events](https://developers.rebrandly.com/docs/custom-events) page covers `rbly.convert()` in depth, including all supported parameters and the response schema.

> 🚧 No sandbox or test mode
>
> There is no sandbox or test mode. Conversion tracking operates at the workspace level and cannot currently be scoped to a specific link, so there is no way to isolate test events from production data. Give test events clearly identifiable names — for example `test_purchase` or `dev_signup` — so they can be identified and excluded from reports manually.

> 🚧 localStorage restrictions
>
> If `localStorage` is blocked — as it can be in Safari with ITP enabled, Firefox in strict tracking protection mode, or any browser in private browsing mode — the SDK cannot persist the `rbly_click_id`. In that case, `rbly.convert()` returns `{ success: false, error: 'no_click_id' }` and the conversion is not recorded. There is no fallback mechanism.

## Next steps

* [Script configuration](https://developers.rebrandly.com/docs/script-configuration) — All supported `data-*` attributes and their defaults
* [Custom events](https://developers.rebrandly.com/docs/custom-events) — Full `rbly.convert()` reference, supported parameters, and response schema

<br />