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

> ## Agent Instructions
> Install the Courier skill before writing code: `npx skills add trycourier/courier-skills`. It carries the verified SDK shapes and the rules you cannot get wrong.
> Authenticate every request with `Authorization: Bearer <API_KEY>`. A workspace has several environments and each has its own keys, which are plain `pk_` strings with no environment prefix. Start with Test.
> Send with `client.send.message` from the Node SDK (`@trycourier/courier` v7 and later, where the client is the default import). Reference a template by its `nt_` id or its alias.
> A send accepts a bare Elemental element list, but storing content on a template requires the top-level elements wrapped in a channel element.
> To translate a template, write one locale at a time with `PUT /notifications/{id}/locales/{localeId}`, which merges into the existing translations. `PUT /notifications/{id}/content` and `PUT /notifications/{id}/elements/{elementId}` overwrite translations along with the content, so send each element's `id` and `locales` back, and first remove every `checksum` and any `locales` key that starts with an underscore.
> Templates and journeys can be built in the Courier app or created through the API. Either way they live in the workspace and are referenced by ID when you send.
> The hosted MCP server is https://mcp.courier.com. For a briefing on what Courier is and when to use it, read https://www.courier.com/llms.txt.
> Prefer the Guides tab for how-do-I questions and the Docs tab for how-does-it-behave questions. The API reference lives under /api-reference.

# Open and click tracking

> How Courier tracks opens and clicks on email, push, and Inbox, how to skip tracking on a link or opens on a send, and how to add a custom tracking domain.

Courier records opens and clicks itself, separately from the delivery confirmation your provider sends back. That's why a message can show `OPENED` before `DELIVERED`, or without it.

## What each channel reports

| Channel | Opened | Clicked | How Courier records it |
| :- | :- | :- | :- |
| **Email** | Yes, when open tracking is on | Yes, when click-through tracking is on | A tracking pixel for opens, a redirect on each link for clicks |
| **Push** | No | Yes | The Courier mobile SDK posts to the message's `trackingUrl` when the user taps it |
| **Inbox** | Yes | Yes | The Courier client SDK reports opened and clicked events from the inbox |
| **SMS** | No | No | Delivery status only |
| **Chat** (Slack, Microsoft Teams, and others) | No | No | Delivery status only |

A `0` in an Opened or Clicked column means "not measured", not "nobody read it", on any channel that can't report that event.

## Turn on email tracking

Open and click tracking for email are two workspace settings in [Settings → Tracking](https://app.courier.com/settings/tracking):

* **Email-open tracking** adds a tracking pixel to every email.
* **Click-through tracking** rewrites every link in an email to pass through Courier's redirect first.

Both apply to every environment in the workspace. Turning either one on or off is recorded in the [audit trail](https://www.courier.com/docs/workspaces/audit-trail.md).

Courier adds the pixel after the email is rendered, so it works on templates built in Design Studio and on templates that use your own HTML.

> [!WARNING]
>
> Links must use absolute URLs. Courier doesn't attach tracking to a relative URL: the email still sends, but the click doesn't get counted.

## Turn tracking off for one link

With click-through tracking on, you can still leave individual links untracked. Deep links into a mobile app are the usual case, since a redirect can stop the operating system from opening the app.

> [tab] Design Studio
>
> Select the button, or the link inside a text block, and turn off tracking in its settings.

> [tab] HTML
>
> Add `data-courier-link-tracking="false"` to the `<a>` tag:
>
> ```html theme={null}
> <a data-courier-link-tracking="false" href="https://example.com/app/orders/1234">Open in app</a>
> ```

> [tab] Elemental
>
> Set `disable_tracking` to `true` on the [action element](https://www.courier.com/docs/design/elemental/elements/action.md), or on a link inside a [text element](https://www.courier.com/docs/design/elemental/elements/text.md):
>
> ```json theme={null}
> {
>   "type": "action",
>   "content": "Open in app",
>   "href": "https://example.com/app/orders/1234",
>   "disable_tracking": true
> }
> ```

## Turn off open tracking for one send

Set `tracking.open` to `false` in the email channel override. The workspace setting stays as it is for every other send.

```javascript Node.js highlight={8} theme={null}
const { requestId } = await client.send.message({
  message: {
    to: { user_id: "user_123" },
    template: "nt_01kx4h2jdafq8bk9aftxak4b40",
    channels: {
      email: {
        override: {
          tracking: { open: false },
        },
      },
    },
  },
});
```

```python Python highlight={8} theme={null}
response = client.send.message(
    message={
        "to": {"user_id": "user_123"},
        "template": "nt_01kx4h2jdafq8bk9aftxak4b40",
        "channels": {
            "email": {
                "override": {
                    "tracking": {"open": False},
                },
            },
        },
    },
)
```

```bash cURL highlight={11} wrap theme={null}
curl -X POST https://api.courier.com/send \
  -H "Authorization: Bearer $COURIER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": {
      "to": { "user_id": "user_123" },
      "template": "nt_01kx4h2jdafq8bk9aftxak4b40",
      "channels": {
        "email": {
          "override": {
            "tracking": { "open": false }
          }
        }
      }
    }
  }'
```

```ruby Ruby highlight={8} theme={null}
response = courier.send_.message(
  message: {
    to: { user_id: "user_123" },
    template: "nt_01kx4h2jdafq8bk9aftxak4b40",
    channels: {
      email: {
        override: {
          tracking: { open: false }
        }
      }
    }
  }
)
```

```go Go highlight={12} theme={null}
response, err := client.Send.Message(context.TODO(), courier.SendMessageParams{
	Message: courier.SendMessageParamsMessage{
		To: courier.SendMessageParamsMessageToUnion{
			OfUserRecipient: &shared.UserRecipientParam{
				UserID: courier.String("user_123"),
			},
		},
		Template: courier.String("nt_01kx4h2jdafq8bk9aftxak4b40"),
		Channels: shared.MessageChannelsParam{
			"email": shared.ChannelParam{
				Override: map[string]any{
					"tracking": map[string]any{"open": false},
				},
			},
		},
	},
})
```

```java Java highlight={7} theme={null}
SendMessageParams params = SendMessageParams.builder()
    .message(SendMessageParams.Message.builder()
        .to(UserRecipient.builder().userId("user_123").build())
        .template("nt_01kx4h2jdafq8bk9aftxak4b40")
        .channels(MessageChannels.builder()
            .putAdditionalProperty("email", JsonValue.from(java.util.Map.of(
                "override", java.util.Map.of("tracking", java.util.Map.of("open", false)))))
            .build())
        .build())
    .build();
SendMessageResponse response = client.send().message(params);
```

```php PHP highlight={9} theme={null}
$response = $client->send->message(
  message: [
    'to' => [
      'user_id' => 'user_123',
    ],
    'template' => 'nt_01kx4h2jdafq8bk9aftxak4b40',
    'channels' => [
      'email' => [
        'override' => [
          'tracking' => ['open' => false],
        ],
      ],
    ],
  ],
);
```

```csharp C# highlight={15} theme={null}
SendMessageParams parameters = new()
{
    Message = new()
    {
        To = new UserRecipient { UserID = "user_123" },
        Template = "nt_01kx4h2jdafq8bk9aftxak4b40",
        Channels = new Dictionary<string, Channel>
        {
            {
                "email",
                new Channel
                {
                    Override = JsonSerializer.Deserialize<Dictionary<string, JsonElement>>(
                        """
                        { "tracking": { "open": false } }
                        """
                    ),
                }
            },
        },
    },
};

var response = await client.Send.Message(parameters);
```

```bash CLI highlight={5} wrap theme={null}
courier send message \
  --api-key "$COURIER_API_KEY" \
  --message.to '{"user_id": "user_123"}' \
  --message.template nt_01kx4h2jdafq8bk9aftxak4b40 \
  --message.channels '{"email": {"override": {"tracking": {"open": false}}}}'
```

```text MCP theme={null}
With Courier MCP, send my nt_01kx4h2jdafq8bk9aftxak4b40 template to user_123 with email open tracking turned off.
```

The other email override fields are listed in [Email providers](https://www.courier.com/docs/integrations/email/overview.md).

## Push tracking

Every push Courier sends carries a `trackingUrl` in its data. Posting an event to that URL updates the message:

* `DELIVERED` when the push arrives on the device.
* `CLICKED` when the user taps it.

The Courier mobile SDKs post both for you once your app is wired up. [Set up mobile push](https://www.courier.com/docs/guides/set-up-mobile-push.md#delivery-and-click-tracking) shows which part of your app reports each event on iOS and Android.

If you handle notifications outside the SDK's hooks, post the event yourself:

```bash theme={null}
curl -X POST https://api.courier.com/e/123_channelTrackingId \
  -H "Content-Type: application/json" \
  -d '{"event":"CLICKED"}'
```

## Inbox tracking

The Courier client SDKs report opened, read, and clicked events from the inbox as users interact with it, so inbox messages fill in their own engagement without any setup.

When a template sends to both email and the inbox, opening the email marks the inbox message as read. This uses the email's tracking pixel, so it needs open tracking on. Reading the inbox message doesn't mark the email as opened.

## Where tracked events show up

| Where | What you see |
| :- | :- |
| [Message logs](https://www.courier.com/docs/monitor/logs.md) | `OPENED` and `CLICKED` events on each message's timeline |
| [`GET /messages/{message_id}`](https://www.courier.com/docs/api-reference/messages/get-message) | `opened` and `clicked`: timestamps of the first open and the first click, in milliseconds since the Unix epoch |
| [Outbound webhooks](https://www.courier.com/docs/monitor/webhooks/outbound.md) | A `message:updated` event each time the status changes to `OPENED` or `CLICKED` |
| [Analytics](https://www.courier.com/docs/monitor/analytics.md) | Open and click rates per template, journey, and broadcast |
| [Metrics API](https://www.courier.com/docs/monitor/template-metrics.md) | `opened` and `clicked` counts as a time series |

Every message keeps any `metadata` you sent with it, including `utm` (`source`, `medium`, `campaign`, `term`, `content`), `tags`, and `trace_id`. It comes back on the message and on every webhook event, so you can join engagement to your own campaign data.

## Custom tracking domain

Tracked links go through Courier's `ct0.app` domain by default. A custom tracking domain, such as `tracking.acme-corp.com`, puts your own domain in every link instead. Recipients see a domain they recognize, and some spam filters treat it more kindly than a shared tracking domain.

> [!NOTE]
>
> A custom tracking domain is available on the Business and Enterprise plans. Setup is done with Courier support.

**1. Send Courier your subdomain**

Email [support](mailto:support@courier.com) the subdomain you want to use, for example `tracking.acme-corp.com`.

**2. Add the DNS records**

Courier sends you two records to add at your DNS provider:

* A certificate validation record, so Courier can serve HTTPS on your subdomain.
* A CNAME that points your subdomain at Courier's tracking infrastructure:

```text theme={null}
tracking.acme-corp.com  CNAME  tracking.ct0.app
```

**3. Wait for activation**

Once the records propagate, Courier support turns the domain on for your workspace. From then on, every tracked link in every email uses it.

**4. Verify**

Send yourself an email with a link in it and hover over the link. It should point at your subdomain, not `ct0.app`.

## Why open rates are unreliable

Open tracking depends on the pixel loading. Inbox security scanners and Apple Mail Privacy Protection load images automatically, which records an open before anyone reads the email, or when no one does. A scanner can even load the pixel on an email that later bounced.

Email clients that block images, common in corporate mail, don't load the pixel, so those opens go unrecorded.

## Limits & behavior

* **Tracking is separate from delivery.** `DELIVERED` comes from your provider. `OPENED` and `CLICKED` come from Courier. Either can arrive without the other.
* **Only the first open and first click are timestamped** on the message. Later opens and clicks don't change `opened` or `clicked`.
* **Push and inbox engagement comes from the SDKs.** It's reported regardless of the email tracking settings.
* **The tracking domain is workspace-wide.** It applies to every tracked link in the workspace, across every template and tenant.

## FAQ

> [accordion] Why are my open rates higher than expected?
>
> Inbox scanners and Apple Mail Privacy Protection load the tracking pixel automatically, and Courier records that as an open. Weigh clicks more heavily when you judge engagement.

> [accordion] Why does a message show OPENED but not DELIVERED?
>
> Opens come from Courier's pixel and delivery comes from your provider, independently. Either the provider hasn't confirmed delivery yet, or delivery tracking isn't set up for it. See [Set up delivery tracking](https://www.courier.com/docs/monitor/analytics.md#set-up-delivery-tracking).

> [accordion] Why don't my SMS messages have an open rate?
>
> A text message can't carry a tracking pixel, so SMS reports delivery status but not opens or clicks.

> [accordion] Why aren't clicks on my push notifications showing up?
>
> The Courier mobile SDK reports push clicks. If your app handles notifications without the SDK's hooks, post `CLICKED` to the message's `trackingUrl` yourself.

> [accordion] How do I stop Courier from rewriting a deep link?
>
> Turn off tracking on that link: in Design Studio's link settings, with `data-courier-link-tracking="false"` in HTML, or with `disable_tracking` in Elemental.

> [accordion] Do I need a custom tracking domain?
>
> `ct0.app` works out of the box, with no custom domain required. A custom domain helps if you want your own brand in every link, or if your recipients' filters are wary of shared tracking domains.
