# Your own page reference

Use this page to look up details and fix errors. To set up Tether on your own page, follow the [guide](https://warplink.app/docs/tether/own-page).

## Allowed sites in detail

The allowed list holds the sites that WarpLink makes codes for. Write each site as an address with no path, such as `https://acme.example`. The address `https://www.acme.example` is a different site. An app can list up to 50 sites.

WarpLink makes a code only for taps on a site on the list. A request from another site answers `403 TETHER_SITE_NOT_ALLOWED`. WarpLink then records the site as observed.

Open the Your own website tab of the app to allow an observed site or to dismiss it. Each site on the tab shows a badge and a note. To stop a site, choose Remove. WarpLink then makes no new code for taps there. A code that WarpLink already made still works until it expires, while its link stays on.

| Badge | What it means |
|-------|---------------|
| Script seen | The script ran on this allowed site. The note shows when it last ran, for example "The script last ran here 2h ago." |
| Not seen yet | You added the site. The script has not run there. Open your page in Safari on an iPhone to test it. |
| Not seen lately | The tab shows the 5 most recent sites where the script ran. This site is not among them. It may have run there before. |
| Not allowed | The script ran on this site, but the site is not on the list. Choose Allow to add it, or Dismiss to hide it. |

## Which link the app gets in detail

The app gets one WarpLink link after the install. The code stands for that link. The script picks the link in two cases, in this order. The [guide](https://warplink.app/docs/tether/own-page#which-link-the-app-opens) shows both cases in one table.

### Case 1: a WarpLink link sent the person to your page [#case-link-sent-person]

1. A person taps a WarpLink link on an iPhone.
2. WarpLink sends the person to your page. It adds a tap marker to the page address. The marker names the link.
3. The script reads the tap marker. It then removes the marker from the address bar. It keeps the marker in memory only.
4. The person taps your button. The script sends the marker to WarpLink and asks for a code.
5. WarpLink checks the marker. The code stands for the WarpLink link that the person tapped.
6. The script copies the code. Then the App Store opens.
7. After the install, the app reads the code. The app gets the WarpLink link that the person tapped.

The install counts for that WarpLink link. In [Results](https://warplink.app/docs/tether/results) it shows under **Your own page, from a link**.

Keep the tap marker when your page redirects. A redirect can remove it. The script then uses Case 2.

### Case 2: the address has no valid tap marker [#case-another-way]

The person came to your page another way, for example from search. Or the tap marker is missing or not valid.

1. The person taps your button. The script finds no valid tap marker.
2. The script reads the `data-warplink-link` attribute on the button.
3. The script sends that link to WarpLink and asks for a code.
4. WarpLink checks the link. The link must belong to your app. It must be active and not expired. It must have Tether on. A referral link does not work here.
5. The code stands for the link that you wrote on the button.
6. The script copies the code. Then the App Store opens.
7. After the install, the app reads the code. The app gets the link that you wrote on the button.

Write the full link address in `data-warplink-link`. Use your handle host, then the slug, for example `acme.aplnk.to/spring-sale`.

These installs count as **From your page** in [Results](https://warplink.app/docs/tether/results). An install with no matching link tap is not tied to a tap. If WarpLink matched an earlier tap of the link that opened a WarpLink page, such as the hosted page, the install is tied to that tap.

You can also put `data-warplink-link` on the script tag. A value on a button wins over the value on the script tag.

### Direct visitors in detail

The [guide](https://warplink.app/docs/tether/own-page#direct-visitors) explains the two rules and where to set them.

Anyone can ask your page for a code. So under **Open the link's screen**, some installs counted as From your page may not be real. Choose **Only after a link tap** when you need counts you can check.

Under **Open the link's screen**, a direct install keeps the link you wrote on the button. Suppose the same phone already has an install from another link. The app then gets the link on the button now, and the first install keeps its own attribution.

### If both are present

A page can have a tap marker and a `data-warplink-link` attribute. The tap marker wins. The link on the button is used only when the tap marker is missing or is not valid.

A valid tap marker can name a link that is paused, expired or has Tether off. WarpLink then refuses the code. The script does not use the link on the button in that case. An invitation link follows Referral handoff instead. It still gets a code.

### If only WarpLink links lead to your page

Still write `data-warplink-link`. A visit can lose its tap marker, for example in a redirect. Then Case 2 applies, and the link on the button is the backup. With no tap marker and no `data-warplink-link`, the script does nothing.

A visit with no tap marker asks for a code for the button link. The rule you [chose for direct visitors](https://warplink.app/docs/tether/own-page#direct-visitors) decides whether the app gets that link.

## If something goes wrong

| What you see | Cause | Fix |
|--------------|-------|-----|
| Nothing happens when a person taps the button | The script does nothing on computers, on Android, or in the browser inside some apps, such as Instagram. Or the button has no `data-warplink-handoff`. Or the script tag has no `data-warplink-app`. Or the page has no tap marker and no `data-warplink-link`. Or the site is not on the list. | Test in Safari on an iPhone. Check the attributes. Allow the site. |
| People do not reach your page | The iOS URL of the link starts with `http://` or `https://`. WarpLink then uses it, not the iOS fallback URL. | Leave the iOS URL empty, or use an app link such as `acmefit://`. |
| A site shows the badge Not allowed | The script ran on a site that is not on the list. The request answers `403 TETHER_SITE_NOT_ALLOWED`. | Choose Allow on the Your own website tab. |
| The tab shows Tap marker lost on a page | People came to this page, on a site you allowed, from another site, and the address had no valid tap marker. The count starts when WarpLink first saw the page. | Your site must keep the tap marker. See [Tap marker lost](#tap-marker-lost). |
| `TETHER_LINK_MISMATCH` | The link is not yours, is paused or expired, has Tether off, or the short address names two links. A tap marker can also name such a link. | Use the full link address of an active Tether link of this app. |
| `TETHER_TAP_REQUIRED` | The button names a referral link, or the page has no valid tap marker and no `data-warplink-link`. | Name a normal Tether link. Or send the person through a WarpLink link. |
| `TETHER_RATE_LIMITED` | A request limit was reached. See [Limits](#limits). | Wait the `Retry-After` seconds. |
| `TETHER_NOT_AVAILABLE` | Tether is off for the app, or the app has no iOS build. | Turn Tether on in the app settings. Add the iOS bundle ID to the app. |

## Tap marker lost [#tap-marker-lost]

The tap marker is text that WarpLink adds to your page address when a WarpLink link sends a person there. It is the text `wl_rt=...` in the address. WarpLink puts it after `#`, or in the query (`?wl_rt=...` or `&wl_rt=...`) when the address already has a # part.

Your site must keep the tap marker until the script reads it. WarpLink cannot recover a marker that your site removed. The fix is a change on your site.

### What you lose

Without the tap marker, the script cannot tell which WarpLink link the person tapped. The app gets the link that you wrote in `data-warplink-link` on the button. Under **Only after a link tap**, the code that your button copies gives the app no link. A tap that went straight to your own page does not count, so the marker must survive.

### Check it in 3 steps

The script removes the tap marker from the address as soon as it reads it. So a page with the script on it never shows the marker. Check with the script off.

1. On a test page, comment out the WarpLink script tag.
2. Tap a WarpLink link that has Tether on and whose iOS fallback URL is your page. Use an iPhone, or desktop Safari with an iPhone entry in the Develop menu, under User Agent.
3. When the page has loaded, show the full address. If `wl_rt=` is anywhere in it, your site kept the tap marker. If not, your site changed the address. See the causes below. Then put the script tag back.

After a fix, run the 3 steps again, then run the test with the script on and watch the warning. The count never goes down, so check that it stops rising.

If the address holds the tap marker but the count keeps rising, see [The script runs too late](#marker-script-late).

### Read the warning

On the Your own website tab, under Allowed sites, the warning **Tap marker lost on** names a page, for example `https://acme.example/en`. It names the page where the script ran. The warning counts visits to that page from another site with no valid tap marker, on a page that a Tether link sends people to. A tap marker from an old tap can expire, and an expired marker counts too.

The warning does not prove that your site removed the marker. A redirect is one possible cause. If your link goes to `/` and the warning names `/en`, check for a redirect to `/en` first.

The count includes visits since WarpLink first saw the page. It never goes down, and the warning does not clear after a fix. A new visit that lost the marker makes it show again. Removing the site from Allowed sites hides it. The tab lists the 3 pages with the highest counts. The script runs only on iPhone and iPad, so the count is for those devices.

### Causes and fixes

**A JavaScript redirect.** For example, your page sends the person to `/en`. A redirect that names only a path drops the tap marker. Add the query and the # part:

```js
location.replace("/en" + location.search + location.hash);
```

A server redirect keeps the # part by default. It drops the query unless it copies the query. Copy the query when the marker is `?wl_rt=`.

**A consent or login page in between.** The person leaves your page and comes back to a plain address. Before you leave, save the full address in `sessionStorage`. When the person comes back, go to that address:

```js
// Before you go to the login or consent page:
sessionStorage.setItem("returnTo", location.pathname + location.search + location.hash);

// When the person is back, on the page that finishes the login or consent:
const back = sessionStorage.getItem("returnTo");
if (back) {
  sessionStorage.removeItem("returnTo");
  location.replace(back);
}
```

If the login page is on another site, `sessionStorage` is not shared. Send the address in a return URL parameter, such as `?returnTo=` followed by the encoded address. Encode it with `encodeURIComponent`, because the # part does not reach a server.

**An app router that rewrites the address on load.** The router replaces the address with a path only. Keep the query and the # part when it does. Here `path` stands for the new path:

```js
history.replaceState(history.state, "", path + location.search + location.hash);
```

**The script runs too late.** <span id="marker-script-late" /> A script tag with `async` runs when it finishes loading, which can be after your router changed the address. Put the script tag in `<head>`, before your app scripts, and remove `async`. A script tag with no `async` or `defer` runs when the browser reaches it.

```html
<script src="https://aplnk.to/handoff.js" data-warplink-app="YOUR_WARPLINK_APP_ID"></script>
```

If you cannot keep the tap marker, the script still works for direct visitors with `data-warplink-link`. The app then cannot get the link that the person tapped.

## Limits [#limits]

| Limit | Value |
|-------|-------|
| Allowed sites for each app | 50 |
| Codes for direct visitors, under `open_link` | 1,000 an hour for each app |
| Installs with no tap | 1,000 an hour for each app |
| Sites that show when the script last ran | The 5 most recent |
| Code requests from one address | 30 a minute |
| Code requests for one link | 300 a minute |
| View and copy events from one address | 120 a minute |

When a limit is reached, the request returns `429 TETHER_RATE_LIMITED` with a `Retry-After` header. The page makes no code until the limit resets. The limit on installs with no tap is checked when the app reads the code. Over it, the code gives no link for that install.

## What the script sends

The script sends requests to `https://aplnk.to`. When the page loads, it loads `/handoff.js`. If the script tag has `data-warplink-app`, it also posts a view event to `/handoff/events`. When a person taps your button, it asks `/handoff/code` for a code. After a copy that worked, it posts a copied event.

The script sends no cookie and writes none. The [privacy page](https://warplink.app/docs/tether/privacy) lists each payload.

The **From your page** funnel in [Results](https://warplink.app/docs/tether/results) counts installs that start on your own page. Under **Open the link's screen**, an install needs no earlier tap. Under **Only after a link tap**, WarpLink must match the install to an earlier tap that opened a WarpLink page, such as the hosted page, and that no other install has used. A tap that went straight to your own page does not match. These codes are not link clicks. They do not count toward your plan's click limit.

## Next steps

- [Tether on your own page](https://warplink.app/docs/tether/own-page) for the four-step guide
- [SDK read modes](https://warplink.app/docs/tether/sdk-modes) for the React Native and Flutter code and the three read modes
- [Test Tether](https://warplink.app/docs/tether/testing) for the checks, the test code and the setup rows that `verify_setup` returns
- [Errors](https://warplink.app/docs/errors) for `TETHER_SITE_NOT_ALLOWED` and the other Tether codes
