---
title: "Dynamic slugs: capture data from the URL path"
description: "On a custom domain, write a link slug with variable segments such as p/{serial} or 01/{gtin}/10/{batch}. One link answers every value, saves it on the visitor as an attribute, and lets a condition route on it from the first scan."
canonical: "https://linkbreakers.com/help/article/dynamic-slugs-capture-data-from-the-url-path"
last-updated: 2026-10-30
---

# Dynamic slugs: capture data from the URL path

> On a custom domain, write a link slug with variable segments such as p/{serial} or 01/{gtin}/10/{batch}. One link answers every value, saves it on the visitor as an attribute, and lets a condition route on it from the first scan.

:::try-ai-prompt {"prompt":"Create a link on my custom domain with the slug menu/{table} that sends visitors to https://example.com/menu","description":"Create a dynamic slug with the Assistant.","target":"assistant"}:::

## Short answer

A **dynamic slug** is a link slug with variable segments, written between braces: `p/{serial}`, `menu/{table}` or `01/09506000134352/10/{batch}`. On your custom domain, one link then answers every address that fits the pattern. Whatever sits in a variable segment is saved on the visitor as an attribute of the same name, so a scan of `qr.brand.com/menu/12` opens the link and records `table = 12`.

That value is available at once. A [visitor data condition](/help/article/how-to-use-visitor-data-conditions) sees it during the same scan, so you can route table 12 to the terrace menu, or batch LOT42 to a recall page, from the very first visit. Dynamic slugs need a [custom domain](/help/article/how-to-create-branded-links-in-linkbreakers), which every plan includes, Free included.

## Quick summary

- Slugs can now have several segments on any domain: `menu/lunch`, `spring/poster-a`
- On a custom domain, a segment written `{name}` matches any value and saves it on the visitor as `name`
- One link covers thousands of printed codes: serial numbers, batches, tables, booths, sales reps
- The value is visible to conditions during the same scan, and on the visitor's profile, timeline, exports, Slack, webhooks and Google Analytics 4
- Exact slugs always win over a dynamic one, so you can still give one value its own link
- Two dynamic slugs that could match the same address are refused, so an address never has two answers
- Available through the dashboard, the REST API, the MCP server, the CLI and the SDKs

## How it works

A slug is the part of a short link after the domain. Until now it was one fixed word. It can now be several segments separated by `/`, and on a custom domain any segment can be a variable.

| Slug | Address scanned | What is saved |
|---|---|---|
| `menu/{table}` | `qr.bistro.com/menu/12` | `table = 12` |
| `p/{serial}` | `go.brand.com/p/A7Q2-9931` | `serial = A7Q2-9931` |
| `booth/{booth}/rep/{rep}` | `ev.acme.com/booth/B14/rep/sara` | `booth = B14`, `rep = sara` |
| `01/09506000134352/10/{batch}` | `qr.brand.com/01/09506000134352/10/LOT42` | `batch = LOT42` |

When an address arrives on your domain:

1. Linkbreakers looks for a link whose slug is exactly that address. If there is one, it answers, as before.
2. Otherwise it compares the address with your domain's dynamic slugs, segment by segment. Fixed segments must be equal (upper or lower case does not matter) and each variable segment takes whatever value is there.
3. The matching link runs its workflow, and the captured values are saved on the visitor.

Values keep the case they were printed with: `LOT42` stays `LOT42`. Each variable captures one segment, up to 200 characters.

## Step-by-step

1. [Connect a custom domain](/help/article/how-to-create-branded-links-in-linkbreakers) if your workspace does not have one yet.
2. Create a link and pick your custom domain.
3. In the slug field, type the pattern with its variables in braces, for example `menu/{table}`. Variable names use lowercase letters, digits and underscores, and start with a letter.
4. Build the workflow as usual: a redirect, a form, a multi-link page, conditions.
5. On the link's page, fill in a value for each variable to get the exact address and a QR code for it, and print that code. For large runs, your printer or packaging tool can generate the codes from the pattern directly.

The slug and the domain are fixed once the link exists, because printed codes depend on them. To change the pattern, create a new link.

## Route on the captured value

Add a [visitor data condition](/help/article/how-to-use-visitor-data-conditions) after the scan and test the attribute by its name:

- `table` equals `12` goes to the terrace menu, everything else to the main menu
- `batch` equals `LOT42` goes to a recall notice, every other batch to the product page
- `rep` equals `sara` goes to Sara's booking page

The condition reads the value captured on this very scan, so it works on a visitor's first visit, before anything is saved to their profile.

## Where the values show up

- **The visitor's profile and activity timeline**: the entry step lists what was saved
- **Exports and the API**: like any other visitor attribute
- **Slack notifications and webhooks**: in the saved attributes of the visit
- **Google Analytics 4**: the [GA4 integration](/help/article/google-analytics-4-integration-for-qr-codes-and-links) sends the names of the fields that were saved, never their values

## Examples

### Serial numbers on products

Print `go.brand.com/p/{serial}` with each unit's serial number. Every scan opens the same registration form, and the serial number is already on the visitor's profile when they submit it, with no field to type.

### Tables in a restaurant

One link, `menu/{table}`, and one sticker per table. You see which tables scan, and you can route the terrace to its own menu.

### Booths and sales reps at an event

`booth/{booth}/rep/{rep}` gives every rep their own code on one link. Leads arrive with the booth and the rep who met them, ready for a webhook to assign them in the CRM.

### GS1 Digital Link on packaging

`01/09506000134352/10/{batch}` answers every batch of a product in the GS1 Digital Link format checkout scanners read. See [GS1 Digital Link QR codes with Linkbreakers](/help/article/gs1-digital-link-qr-codes-with-linkbreakers).

## Exact slugs win

An exact slug always answers before a dynamic one. With `menu/{table}` in place, you can still create `menu/vip` as its own link with its own workflow. The dynamic slug answers every other table.

## From an AI agent or a script

Create the link with the pattern as its `shortlink` and your domain's `custom_domain_id`:

```json
POST /v1/links
{
  "destination": "https://example.com/menu",
  "shortlink": "menu/{table}",
  "custom_domain_id": "d290f1ee-6c54-4b01-90e6-d701748f0851"
}
```

The same works from the [MCP server](/help/article/mcp-server-setup), the CLI and the SDKs. An agent connected over MCP can create a pattern, then read the captured values back from visitor profiles.

## Limits and caveats

- **Custom domains only.** On the shared Linkbreakers domain, slugs can have several segments but no variables, since every workspace shares those addresses.
- **One segment per variable.** `{serial}` captures one segment, never a `/`.
- **No overlap.** Two dynamic slugs of a domain that could match the same address are refused: `01/{gtin}/10/{batch}` and `01/09506000134352/10/{lot}` cannot both exist. Make one of their fixed segments different.
- **A variable once per slug.** Each name can appear only once.
- **Path only.** Values in the query string (`?17=261231`) are not saved as attributes.
- **Fixed after creation.** The slug and domain of a link cannot be changed later.

## Frequently asked questions

### Is it available on the Free plan?

Yes. Dynamic slugs need a custom domain, and the Free plan includes one.

### What happens if someone types a value that was never printed?

The link answers it like any other value and saves it. If only some values are valid, route the known ones with a visitor data condition and send the rest to a fallback page.

### Can a dynamic slug have no fixed segment at all?

Yes, `{code}` answers every one-segment address on your domain that has no exact link. It is useful for a domain dedicated to one campaign.

### Does matching slow down scans?

No. Exact slugs are looked up first, as before. Dynamic slugs are only compared when no exact slug answers, and they are kept in memory between scans.

### Can I use the captured value in a redirect?

Not yet in the destination address itself. Route on it with a visitor data condition, or read it in your webhook.

## Sources

- Linkbreakers dynamic slugs, checked in the product on 2026-10-30.

## Last reviewed

2026-10-30 by Laurent Schaffner.
