> AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt # Link tracking and UTM tags Canonical URL: https://posthog.com/docs/workflows/email/link-tracking > **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.posthog.com` instead of `https://app.posthog.com` (app host for links). ## On this page - [Opens and clicks](#opens-and-clicks) - [Leave one link alone](#leave-one-link-alone) - [Sensitive emails](#sensitive-emails) - [Connect clicks to sessions](#connect-clicks-to-sessions) - [UTM tags](#utm-tags) - [Tracking consent](#tracking-consent) PostHog counts opens with a tiny image in each email, and counts clicks by sending links through a redirect. You choose which emails it tracks, and you can tag links so web analytics shows which email sent each visitor. ## Opens and clicks Every automation email step and broadcast email has **Track opens and link clicks**, on by default. Turn it off for an email that shouldn't be tracked. With it off, PostHog adds no image and doesn't rewrite links. It still records deliveries, bounces, and unsubscribes. Opens and clicks become PostHog events only when [engagement events](https://posthog.com/docs/workflows/email/engagement-events.md) are on. ![An automation email step's settings with the Track opens and link clicks, Connect clicks to sessions, and Add UTM tags to links toggles](https://res.cloudinary.com/dmukukwp6/image/upload/w_1600,c_limit,q_auto,f_auto/email_step_tracking_light_bfc7f14bef.png) ## Leave one link alone Some links break when they go through a redirect, such as app deep links and universal links. Add `data-ph-no-track` to the link's `` tag, in a **Custom HTML** block: ```html Open the app ``` The link keeps its address, and PostHog doesn't count its clicks. ## Sensitive emails Transactional emails with sign-in codes or reset links can be marked as sensitive. PostHog then doesn't rewrite their links, so a token never goes through a redirect. See [sensitive data and tracking](https://posthog.com/docs/workflows/transactional/sensitive-data.md). ## Connect clicks to sessions **Connect clicks to sessions**, on by default, links each tracked click to the session it starts on your site, including its session replay. It adds a URL parameter to links on the domain you send from and its subdomains. Your site needs [posthog-js](https://posthog.com/docs/libraries/js.md). ## UTM tags Turn on **Add UTM tags to links**, and PostHog adds these to each link in the email: | Tag | Default | | --- | --- | | `utm_source` | `posthog` | | `utm_medium` | `email` | | `utm_campaign` | The broadcast or automation name | | `utm_content` | The email step name | Change any value, or use Liquid in it. Click **Save as team default**, and new emails start with the same values. You can also set the defaults in [**Messaging** > **Settings** > **UTM tags on email links**](https://app.posthog.com/workflows/settings). PostHog tags only `http` and `https` links. It keeps any `utm_` value a link already has, and skips PostHog's own links, such as the unsubscribe link. To leave one link untagged, add `data-ph-no-utm` to its `` tag. ## Tracking consent Some countries need a person's consent before you track their opens and clicks. Go to [**Messaging** > **Settings** > **Email tracking consent**](https://app.posthog.com/workflows/settings), and pick: | Mode | What it does | | --- | --- | | **No consent enforcement** | Track by each email's setting. The default. | | **Opt-out** | Track everyone except people who said no. | | **Opt-in** | Track only people who said yes. | People choose on the [preferences page](https://posthog.com/docs/workflows/email/unsubscribes.md#the-preferences-page). Consent applies only to marketing email, and never tracks an email that has tracking off.