# Dynamic Links

A LinkSense dynamic link is a single URL that behaves differently depending on how it's accessed. LinkSense is a dynamic link management platform for mobile and web apps. When someone clicks your link, LinkSense:

1. Detects the user's device type and operating system.
2. Checks whether the request is from a social-media bot (and serves preview metadata if so).
3. Routes the user to the appropriate destination — app, app store, or web URL.
4. Records analytics for the click.

You can share the same link in social media, email, push notifications, or print, and each user still gets the best experience for their device.

## Creating a link

1. From your project, click **New Link**.
2. Set a name (the only required field) and an optional custom path.
3. Configure routing: attach a registered iOS and/or Android app, set per-platform fallback URLs, and set a desktop URL.
4. Optionally add social preview metadata.
5. Save and copy the generated URL.

## Device routing

### iOS

Attach a registered iOS app (`ios_app_id`) to open or deep-link the app via Universal Links, or to send users to the App Store when the app isn't installed (requires a registered iOS app with bundle ID and team ID). Set `ios_fallback_url` to control where iOS users go when no app target applies.

### Android

Attach a registered Android app (`android_app_id`) to open or deep-link the app via App Links, or to send users to the Play Store when the app isn't installed (requires a registered Android app with package name and SHA-256 fingerprint). Set `android_fallback_url` to control where Android users go when no app target applies.

### Desktop

Desktop users (Windows, macOS, Linux) go to the `desktop_url`. If no target applies to a user's device, the project's landing page is shown.

## Custom paths

Each link can have a readable custom path:

```
https://your-subdomain.linksense.net/summer-sale
```

Custom paths must be unique within a project. They may contain lowercase letters, numbers, and hyphens. If omitted, a random short code is generated.

Certain paths are reserved (system paths such as `.well-known` and similar internal routes) and cannot be used.

## Fallback URLs

Fallback URLs are configured per platform: `ios_fallback_url` and `android_fallback_url` control where users go when the attached app can't be opened. Desktop users go to `desktop_url`. None of these are required — if no target applies to a user's device, the project's landing page is shown.

## Social previews

When a social-media bot crawls the link, LinkSense serves an HTML page with Open Graph tags instead of redirecting. This lets platforms render a rich preview card. Each link can have its own social preview title, description, and image.

## Field reference

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Internal name for the link (not shown to users). |
| `custom_path` | string | no | Custom path slug; auto-generated if empty. |
| `desktop_url` | url | no | Destination URL for desktop users. |
| `ios_app_id` | string | no | UUID of a registered iOS app in this project. |
| `android_app_id` | string | no | UUID of a registered Android app in this project. |
| `ios_fallback_url` | url | no | Fallback URL when the iOS app is not installed. |
| `android_fallback_url` | url | no | Fallback URL when the Android app is not installed. |
| `social_title` | string | no | Title for social preview cards. |
| `social_description` | string | no | Description for social preview cards. |
| `social_image_url` | url | no | Image URL for social preview cards. |
