Email links and unsubscribe
Overview
Section titled “Overview”Emails sent by amabledata (broadcasts, automations and other sends from the email module) contain three kinds of public links that are handled by the edge worker:
| Link | URL | What it does |
|---|---|---|
| Click redirect | https://<tracking host>/r/<token> |
Records the click and sends the reader to the real destination |
| Open pixel | https://<tracking host>/o/<token> |
An invisible 1×1 image that records the open |
| Unsubscribe | https://<tracking host>/unsub/<token> |
A page to stop marketing emails, plus the one-click endpoint mail apps use |
The tracking host is the workspace’s verified tracking domain from Settings › Domains (see Domains), for example https://links.example.com. Without one, the edge worker’s default address is used. A branded tracking domain makes links look trustworthy and improves deliverability.
How you write emails and configure sending is covered in Email templates, Email sending settings and Suppressions.
How it works
Section titled “How it works”Signed tokens
Section titled “Signed tokens”Every link carries a signed token that ties it to one workspace, one message and one contact.
- Tokens never expire: an unsubscribe link in an old email must keep working.
- Tokens cannot be forged or edited: a changed token is rejected.
- The click token contains the destination URL itself, so the redirect can only lead where the email pointed. It can never be abused as an open redirect.
Click tracking
Section titled “Click tracking”When an email is sent, every http and https link in its HTML is rewritten to a /r/<token> link. Links that already point to the tracking host (such as the unsubscribe link) are left as they are.
When the reader clicks:
- The edge worker verifies the token and redirects (HTTP 302) to the original destination.
- A parameter
_amb_cis added to the destination URL. It is a signed contact identity: if the destination site runs the amabledata tracker, the first pageview sends it to amabledata, which links the browser to the contact, and the tracker removes it from the address bar. It is accepted for 90 days after the click. - The click is recorded on the message: click count, first click time and which link was clicked. The
email.link_clickedevent fires (marked as unique on the first click). - If no open was recorded yet, the click also records the open (
email.opened), because a click proves the email was opened even when images were blocked.
If the token is invalid (cut, altered, or not leading to an http or https address), the reader sees a small page titled Link unavailable with the text This link is not valid or has expired. and a 404 status. Like the unsubscribe page, it is in English or Italian depending on the reader’s browser language (Link non disponibile / Questo link non è valido o è scaduto.), uses no scripts, is never cached and is marked noindex.
Open tracking
Section titled “Open tracking”A 1×1 transparent GIF pointing to /o/<token> is added at the end of the HTML body. When the reader’s mail app loads images, the open is recorded (open count, first open time) and the email.opened event fires (unique on the first open). The image is always returned, never cached, and recording happens in the background so it never slows the email down.
Opens are an estimate: mail apps that block images record no open (until a click), and some privacy features load images automatically.
Unsubscribe
Section titled “Unsubscribe”Marketing emails get an unsubscribe link in two places:
- in the content, wherever your template uses the
unsubscribe_urlvariable (Unsubscribe link in the Liquid helper); - in the email headers
List-UnsubscribeandList-Unsubscribe-Post: List-Unsubscribe=One-Click, so mail apps can show their own Unsubscribe button and unsubscribe with one click (RFC 8058).
Transactional emails do not get the unsubscribe headers.
The unsubscribe page
Section titled “The unsubscribe page”Opening /unsub/<token> shows a minimal page titled Unsubscribe, in English or Italian depending on the reader’s browser language. It uses no scripts or external resources, cannot be framed by other sites and is marked noindex.
| Situation | Text |
|---|---|
| Valid link | Do you want to stop receiving marketing emails at followed by the masked address (for example ma••••@example.com) and a Unsubscribe button |
| After confirming | You have been unsubscribed. You will not receive marketing emails at this address anymore. |
| Already unsubscribed | This address is already unsubscribed. |
| Invalid link | This unsubscribe link is not valid or has expired. |
| Test email | This is a test email: the unsubscribe link does nothing. |
| Temporary error | Something went wrong. Please try again in a few minutes. |
The address is masked (first two characters, then dots) so that a forwarded email does not reveal it in full. Opening the page does not unsubscribe: only the button (a form post) or the one-click request does, which protects readers from link scanners that open every URL.
amabledata offers a single choice, unsubscribing from marketing emails; there is no preference center with topics.
What unsubscribing does
Section titled “What unsubscribing does”Unsubscribing is idempotent. The first time it:
- adds the address to the workspace suppression list with reason unsubscribe and source link (page) or one_click (mail app button);
- marks the message as unsubscribed in its statistics;
- fires the
email.unsubscribedevent (usable in automations and webhooks); - sets the contact’s marketing status to unsubscribed.
Later marketing sends to that address are skipped as suppressed.
Step by step
Section titled “Step by step”Use a branded tracking host
Section titled “Use a branded tracking host”- Open Settings › Domains and add a tracking domain (for example
links.example.com). - Create the DNS records shown and wait until the domain is verified.
- New emails use it automatically for click, open and unsubscribe links.
Emails already sent keep their original links, which keep working.
Add an unsubscribe link to a template
Section titled “Add an unsubscribe link to a template”- Open the template in Marketing › Email templates.
- Insert a link whose URL is the
unsubscribe_urlvariable, for example in the footer:<a href="{{ unsubscribe_url }}">Unsubscribe</a>. - Send a test: in test emails the link opens the test notice and does nothing.
Unsubscribe (as a recipient)
Section titled “Unsubscribe (as a recipient)”- Click the unsubscribe link in the email, or the Unsubscribe button of your mail app.
- On the page, click Unsubscribe. (With the mail app button, it happens immediately.)
- The confirmation appears.
Reference
Section titled “Reference”| Endpoint | Method | Answer |
|---|---|---|
/r/<token> |
GET | 302 to the destination with _amb_c; 404 Link unavailable page if invalid |
/o/<token> |
GET | 200, 1×1 GIF, no-store |
/unsub/<token> |
GET | Unsubscribe page |
/unsub/<token> |
POST (form) | Confirmation page |
/unsub/<token> |
POST body List-Unsubscribe=One-Click |
Plain-text confirmation (200), or error / invalid (400) |
| Event | Fired when |
|---|---|
email.link_clicked |
Every click (flag unique on the first) |
email.opened |
Every open, or the first click without a prior open (flag unique on the first) |
email.unsubscribed |
The first unsubscribe of the address |
Limits and permissions
Section titled “Limits and permissions”- Recipients need nothing: the token is the only proof.
- Unsubscribe links work forever, even after a message is deleted; if the message no longer exists the address is still suppressed.
- Managing suppressions in the app requires the email permissions of your role.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Cause | Fix |
|---|---|---|
| Links point to a generic address instead of your domain | No verified tracking domain at send time. | Verify a tracking domain; future sends use it. |
| A content link opens Link unavailable (This link is not valid or has expired.) | The /r/ URL was cut or altered (for example by line wrapping in a forward). |
Click the link in the original email. |
| An unsubscribe link shows This unsubscribe link is not valid or has expired. | The /unsub/ URL was cut or altered. |
Click the link in the original email, or use the mail app’s Unsubscribe button. |
| Opens are much lower than clicks | Images blocked by the reader’s mail app. | Rely on clicks; every click also counts as an open. |
| A contact unsubscribed but you never saw them click | They used the mail app’s one-click button. | Expected: the suppression source is one_click. |
_amb_c stays in the destination URL |
The destination site has no amabledata tracker. | Install the tracker (see Install the tracker); the parameter is otherwise harmless. |

