# Smart links (Smart Flow)

<div class="doc-callout doc-callout--info">
  <strong>What it is</strong>: A <strong>smart link</strong> is a single short URL (<code>onlynk.me/&lt;slug&gt;</code>) backed by a visual <em>flow</em>. Instead of always sending people to one place, the flow inspects each visitor and routes them to the right destination — a redirect, one of your link pages, a deeplink, or a block.
</div>

## What it is

A regular [link page](https://docs.onlynk.me/glossary/) always shows the same thing. A **smart link** evaluates a small decision graph — the **Smart Flow** — at the moment of the visit and chooses an outcome based on who's visiting.

You build the flow in a drag-and-drop editor: drop **condition** nodes (geo, device, referrer, schedule, A/B split…), connect their branches to **action** nodes (redirect, landing page, deeplink, 404, block), and OnLynk follows the flow from top to bottom on every visit.

Typical uses:

- Send US visitors to your `.com` store and EU visitors to your `.eu` store
- Route iOS taps to the App Store and Android taps to Google Play
- Run an A/B test that splits traffic 50/50 between two destinations
- Open a campaign only during a launch window, and fall back to a waitlist outside it
- Escape Instagram's in-app browser before redirecting (see [deeplink](https://docs.onlynk.me/features/deeplink/))

## How it works

A smart link lives at `onlynk.me/<slug>` — the **same address space as your [link pages](https://docs.onlynk.me/glossary/)**, so a slug can be used by a page *or* a smart link, never both. For every visit to that URL:

1. OnLynk builds a **visitor context** from the request — country, referrer, device/OS/browser, language, in-app browser, and how many prior visits this visitor has made.
2. Evaluation starts at the **Entry** node and checks each condition in turn, following the matching branch.
3. The first **action** node it reaches is the outcome, which is applied immediately.
4. If the flow is missing, invalid, or ends without an action (a dead end), the link falls back to its **Fallback URL**.

Smart links are **cookieless** — nothing is written to the visitor's device, so there is no cookie banner. Each saved version of a flow is tracked, so analytics always reflect the version that produced a given visit.

## Conditions

Drop any of these into the flow. A condition splits traffic into branches; connect each branch to the next step.

| Condition | Routes by | Branches |
|---|---|---|
| **Geo** | Visitor country (allow / block lists) | true / false |
| **Device** | OS (iOS, Android, Windows, macOS, Linux), device type (mobile, desktop, tablet), browser (Chrome, Safari, Firefox, Edge) | true / false |
| **Referrer** | Referring host, with **contains**, **starts with**, or **equals** matching | true / false |
| **Language** | Primary browser language (e.g. `fr`, `en`) | true / false |
| **In-app browser** | Specific in-app webviews (Instagram, TikTok…) or any | true / false |
| **Schedule** | Weekdays, a daily time window, and/or a date range — in a chosen timezone | true / false |
| **Visit count** | How many times this visitor has hit the link (`==`, `>=`, `<=`, `>`, `<`) | true / false |
| **A/B split** | Random weighted split — define variants whose percentages sum to 100 | one branch per variant |

A/B splits are **deterministic per visitor**: the same visitor is consistently assigned to the same variant, so refreshes don't bounce them between destinations.

## Actions

An action is a terminal node — reaching it ends evaluation.

| Action | What it does |
|---|---|
| **Redirect** | Sends the visitor to a URL with a `301` (permanent) or `302` (temporary) status |
| **Landing page** | Shows one of your existing OnLynk [link pages](https://docs.onlynk.me/glossary/) |
| **Deeplink** | Opens the destination in the system browser, escaping in-app webviews (see [Deeplink](https://docs.onlynk.me/features/deeplink/)) |
| **404** | Returns a styled "not found" page |
| **Block** | Returns a styled restricted/blocked page |

If the flow reaches a dead end (a branch with no action), the link's **Fallback URL** is used instead — so a smart link always resolves to *something*.

## Analytics

Every visit writes one row to a dedicated, cookieless analytics store, capturing the **path** of nodes the visitor traversed plus their country, device, OS, browser, and referrer. Because the full path is recorded, the smart-link analytics view (**Dashboard → Smart links → your link → Analytics**) can break results down by:

- **Final action** — how many visitors ended in each redirect / landing / block
- **Per-condition branch** — true vs. false split at each condition
- **A/B variant** — traffic share and landing-page conversion per variant
- **Country, device, OS, browser, referrer** breakdowns

<div class="doc-callout doc-callout--info">
  Smart-link analytics are separate from <a href="/page-analytics/">page analytics</a> — they measure flow routing, not page interactions.
</div>

## Create a smart link

1. In the dashboard, open **Links** (the unified pages + smart-links dashboard) and choose **New → Smart link**
2. Give it a **title** and pick a **slug** — the public path becomes `onlynk.me/<slug>`. Slugs are validated against reserved words and must be free across both your link pages and smart links.
3. Set a **Fallback URL** — where visitors go if the flow can't resolve
4. Open the **flow editor** and drag in conditions and actions, connecting branches from **Entry** down to your actions
5. **Save** — the flow is versioned automatically
6. Toggle **Enabled** when you're ready to serve traffic

Smart links live inside your active [workspace](https://docs.onlynk.me/organizations-and-teams/) (personal or organization) and can be filed into folders and groups alongside your link pages.

<div class="doc-callout doc-callout--caution">
  <strong>Plan & limits</strong>: Smart links share the same <strong>links budget</strong> as your link pages — each smart link counts toward your plan's total link allowance.
</div>

## Custom domains & shared reports

Smart links aren't limited to the default OnLynk host:

- **Custom domains** — attach a smart link to a [custom domain](https://docs.onlynk.me/custom-domains/) you own so it serves under your own hostname, and optionally make it the domain's **home** (shown at the root URL). A domain's home can be a page *or* a smart link, but not both.
- **Shared reports** — on agency plans, smart links can be bundled into a [shared analytics report](https://docs.onlynk.me/page-analytics/) alongside your pages, where they contribute a visits count.

## Related

- **[Deeplink](https://docs.onlynk.me/features/deeplink/)** — The deeplink action escapes in-app browsers
- **[Custom domains](https://docs.onlynk.me/custom-domains/)** — Serve a smart link under your own hostname
- **[Geo-restrictions](https://docs.onlynk.me/geo-restrictions/)** — Country rules on a single link page (vs. geo branching in a flow)
- **[Direct link](https://docs.onlynk.me/features/direct-link/)** — Skip the landing page on a standard link
- **[Page analytics](https://docs.onlynk.me/page-analytics/)** — Analytics for link pages
- **[Organizations & teams](https://docs.onlynk.me/organizations-and-teams/)** — Workspaces that own your smart links