Set up your app
Web (smart banner)
Add a DL2App smart app banner to your website, resolve links and carry campaign tags into your app links.
The web SDK is for your website, not your app. It shows an “open in the app” banner on phones, a QR card on desktop if you want one, and has helpers for links and events. It has no dependencies and sets no cookies; the only thing it stores is one localStorage entry that remembers a dismissed banner.
The quick way: one script tag
If all you want is the banner, you don’t need the SDK. Paste this before </body> on every page that should show it, using your project’s link address:
<script async src="https://myapp.dl2.app/_/banner.js"></script>Then open App banner in your project to switch it on and set the title, button label, colours, position and what the button opens (a chosen link, or the same path as the page the visitor is on). Changes reach your site within five minutes. The same page shows how often the banner was seen and tapped, and taps are tagged utm_medium=banner so they appear under Campaigns.
While the banner is switched off the script loads and shows nothing, so you can add the tag first and turn it on later.
In code: the web SDK
npm install @dl2app/webimport DL2 from "@dl2app/web";
DL2.init({ key: "pk_live_xxx", host: "myapp.dl2.app" });
DL2.banner({
appName: "My App",
icon: "https://www.myapp.com/app-icon.png",
link: "welcome", // slug or path the Open button opens
qr: true, // on desktop, show a QR code instead
});Why the button uses the other host
The banner’s button points at myapp-alt.dl2.app. iOS opens an app only when a tap crosses from one domain to another, so a button on your own site that pointed at a link on the same domain would stay in the browser. If host is a custom domain, set altHost explicitly.
Also available
DL2.resolve(url): what a link means (path, data, campaign tags) without following it.DL2.track(name, { value, currency, props }): report a web event.DL2.withUtm(link): copy the page’s campaign tags onto an app link so they survive into the app.