# Smart app banner for Android and iPhone: an "Open in app" bar that keeps the deep link

> What Apple's Smart App Banner does and doesn't do, why Android has no equivalent, and how to add an "Open in app" banner to your mobile site that opens the right screen on both platforms and survives an install.

Source: https://straitlink.in/blog/smart-app-banner-android-iphone-open-in-app/

Plenty of people meet your product on your mobile website first: from a Google search, a shared article, an email that opened in the browser. Some of them already have your app. A small bar at the top of the page, "Open in app", is the polite way to move them over. It's called a **smart app banner**, after Apple's version, and it's a low-effort way to turn mobile web visits into app sessions.

This post covers what Apple's built-in banner does, where it stops (including all of Android), what a good custom banner needs, and how to add one whose tap goes through a deep link, so it opens the right screen whether or not the app is installed.

## Apple's Smart App Banner

Safari on iPhone and iPad has a banner built in. You add one meta tag to the page's `<head>`:

```html
<meta name="apple-itunes-app" content="app-id=123456789, app-argument=https://shop.example.com/product/42">
```

According to Apple's documentation:

- `app-id` is required: your app's App Store ID.
- `app-argument` is optional: a URL passed to your app when the banner opens it, so the app can go to the matching screen.
- If the app is installed, tapping the banner opens it. If not, the banner shows **View** and goes to the App Store listing.
- After a download, when the person comes back to the web page, the button changes to **Open**, and tapping it opens the app with the page's context.
- Once someone closes the banner, it doesn't come back when they return to the page.
- It doesn't show inside a frame, and it doesn't appear in the iOS simulator.

It's free, it looks native, and people trust it. Use it if your traffic is mostly Safari on iPhone and you have nothing to measure.

## Where Apple's banner stops

- **Safari only.** Apple documents the banner as a Safari feature, so don't count on it in Chrome on iPhone, other iPhone browsers or in-app browsers such as Instagram's and Facebook's.
- **No Android.** Android has no meta tag that shows a ready-made "Open in app" bar for an installed app. Google's guidance for app promotion suggests a small HTML banner (or Chrome's own install features) rather than a full-screen overlay.
- **The install loses the page unless they come back.** `app-argument` reaches the app when the banner opens it. Someone who installs from the App Store and then opens the app from the home screen, instead of returning to the web page, starts on your first screen.
- **You can't see what happened.** There's no count of banner taps, opens or installs from it.

So most teams that care about Android, in-app browsers or numbers build their own banner.

## What a good custom banner does

A custom banner is a few lines of HTML and CSS. The details that make it work well are mostly about when it shows and where the tap goes:

1. **Phones only.** On a computer, an "Open in app" bar has nothing to open.
2. **Not inside your own app.** If your app shows your website in a web view, people are already in the app. The banner needs a way to know: a token in your web view's user agent, or a cookie your app sets.
3. **Remember a close.** Someone who dismissed it shouldn't see it on every page view. Thirty days is a common choice.
4. **The tap goes through a deep link, not a store URL.** A banner that links to the App Store or Google Play sends people who already have the app to a store page. A banner that links to your own app's URL scheme fails for people who don't. A deep link decides per tap: open the app if it's installed, otherwise go to the store and keep the destination through the install.
5. **The page's screen, not the home screen.** A product page's banner should open that product in the app.
6. **Small.** Google's Search guidance recommends banners that take up a small fraction of the screen instead of full-page interstitials that hide the content. Keep it a bar.

## Adding one with Strait

The [web SDK](https://straitlink.in/docs/sdks/web/) has a banner built in. It's a plain link to your Strait link, so a tap on it is handled like any tap: the app opens on the link's screen if installed, and otherwise the store opens with the destination kept. On Android that survives the install exactly, through the Google Play Install Referrer. On iPhone, the store hand-off works, and install matching after it is opt-in.

Make a link for the banner in the dashboard (or one per page through the API), install the SDK from GitHub ([the install line](https://straitlink.in/docs/sdks/web/#install)), then:

```ts title="main.ts"
import { Strait } from '@straitlink/web';

Strait.banner({
  link: 'https://hilltop.strait.link/app',
  title: 'Hilltop Shoes',
  subtitle: 'Track your order in the app',
  icon: '/icons/app-192.png',
  appUserAgent: 'HilltopShoesApp/',   // hide it inside your own app's web view
});
```

What it does by default, from the [smart banner docs](https://straitlink.in/docs/smart-banner/):

- Shows on phones and tablets only, at the top of the page (or `position: 'bottom'`).
- Hides inside your app when you pass `appUserAgent` or your own `inApp` check, and on its own in web views with a React Native WebView or `flutter_inappwebview` bridge. It still shows in Instagram's or WhatsApp's in-app browsers, which aren't your app.
- Stays hidden for 30 days after a close (`dismissDays` changes that).
- Makes no requests and sets no cookies. It stores one value in the browser, the time it was closed.

For a banner that opens the page the visitor is on, create one link per page through the [links API](https://straitlink.in/docs/api/) and pass that page's link.

## Banner copy that earns the tap

The bar has room for an icon, a title, one line of text and a button, so each word has to work:

- **Title: your app's name.** People recognise the icon and the name from their home screen. A slogan makes them wonder whose banner it is.
- **Subtitle: what the app does better on this page.** "Track your order live", "Save this recipe offline", "Pay in one tap". The generic "Get our app" tells them nothing about why they'd leave the page they're on.
- **Button: what happens.** "Open in app" is honest for people who have the app. If most of your visitors are new, "Get the app" may read better, and the tap behaves the same either way.
- **Match the page.** A product page's subtitle can name the product's benefit in the app; a help article's can mention the in-app chat. Per-page links make that easy, because each page passes its own link and its own text.

Change one thing at a time and compare banner taps per page view before and after. Small wording changes are easy to measure when the banner has its own link.

## Use one banner on iPhone, not two

If you keep Apple's meta tag and add a custom banner, Safari users see two bars. Pick one. If you need the same banner on Android and iPhone, or banner taps in your analytics, use the custom one everywhere and remove the meta tag. If you only care about Safari and want the native look, keep Apple's.

## In-app browsers need more than a banner

A banner on a page loaded inside Instagram's browser can show, but the tap on it is still a tap inside Instagram's browser. The link server recognises that browser and answers with a page made for it: on Android, an **Open in app** button that hands the tap to the app; on iPhone, a short explanation of how to open the link in Safari. You can see what happens for each browser in the [Will it open my app?](https://straitlink.in/tools/will-it-open/) simulator, and app by app on the [open from any app](https://straitlink.in/open-app-from/) pages.

## Measuring the banner

Give the banner its own link (or a tag on per-page links) and its taps show up separately in Analytics, with installs and app opens joined to each tap. Compare banner taps with page views from your web analytics to see how many phone visitors move to the app, and how many of those were new installs. [Analytics: how we count](https://straitlink.in/docs/analytics/) explains each number.

## A checklist

- [ ] Phones only, and hidden inside your own app
- [ ] The tap goes through a deep link that knows whether the app is installed
- [ ] Product and article pages open their own screen, not the home screen
- [ ] Apple's meta tag removed if you use a custom banner on iPhone
- [ ] Tested on a real phone with the app installed and without it ([Test my link](https://straitlink.in/tools/test-my-link/))
- [ ] App Links verified for your link domain ([App Links checker](https://straitlink.in/tools/app-links-checker/))

## Sources and how we checked

- Apple, [Promoting apps with Smart App Banners](https://developer.apple.com/documentation/webkit/promoting-apps-with-smart-app-banners): the meta tag, `app-id` and `app-argument`, the View and Open behaviour, closing, frames and the simulator.
- Google Search Central, [Avoid intrusive interstitials and dialogs](https://developers.google.com/search/docs/appearance/avoid-intrusive-interstitials): banners instead of full-page interstitials, and the app promotion advice.
- The banner's defaults and storage are from the Strait web SDK (@straitlink/web 0.8.7) and its docs. Universal Links were tested on a real iPhone in October 2026; iPhone install matching is opt-in.
