BlogWhatsApp

WhatsApp template button deep links: make URL buttons open your app

· 8 min read · By the Strait team

How to put a deep link behind a WhatsApp Business template URL button, so a tap opens your app on the right order or offer. Static and dynamic URL buttons, Meta's rules, one link per order, expiry, counting and testing.

Order updates, payment reminders, abandoned-cart nudges and offer broadcasts on WhatsApp are mostly sent as template messages, and the part people tap is usually a button, not a link in the text. "Track order", "Pay now", "View offer". If that button sends people to a mobile web page when they have your app installed, you're paying for a message that lands them in the wrong place.

This post is about the button itself: how WhatsApp's URL buttons work, which of Meta's rules shape your link, and how to set them up so a tap opens your app on the exact order or offer, even for someone who has to install it first. For links in ordinary chat messages, see how to open your app from WhatsApp links.

What a URL button is

A template is a message format you submit to Meta for approval before you can send it. Templates are what a business uses to start a conversation, for example outside the window in which a customer has recently messaged you. Each template can carry buttons, and a URL button opens a web address when tapped.

Meta's documentation for template components sets the rules that matter here:

  • A template can have up to two URL buttons, within up to ten buttons in total. With four or more buttons, WhatsApp shows two and puts the rest behind "See all options".
  • A URL can be up to 2,000 characters.
  • A URL supports one variable, appended to the end of the URL. You write the button as https://example.com/shop?promo={{1}} and pass the value for {{1}} when you send each message.
  • When you submit a template with a variable, you give an example value so Meta can review it.

So there are two kinds of button: a static one, where every recipient gets the same URL, and a dynamic one, where the end of the URL changes per message.

For a broadcast ("Diwali sale, 40% off"), every recipient should land on the same screen. Make one deep link for the campaign and put it in the button as is:

Code
https://hilltop.strait.link/diwali-sale

Put the campaign in the link's destination, for example https://shop.example.com/sale/diwali?utm_source=whatsapp&utm_campaign=diwali-2026. The source and campaign then come from the link itself, without anything in the button.

"Track order" needs the order. Meta allows one variable at the end of the URL, and a Strait link's slug sits at the end of its URL. That's a clean fit: make one link per order, and send its slug as the variable.

Write the template button with a fixed prefix and the variable last:

https://hilltop.strait.link/order-{{1}}

When an order is placed, create the matching link from your server with the links API:

Terminal
curl https://strait.link/v1/links \
  -H "Authorization: Bearer $SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "slug": "order-48213",
        "longUrl": "https://shop.example.com/orders/48213?utm_source=whatsapp&utm_campaign=order-updates",
        "expiresAt": "2026-11-05T00:00:00Z" }'

Then send the template with 48213 as the value for {{1}}. The person taps https://hilltop.strait.link/order-48213, and the app receives /orders/48213.

Why one link per order, and not one link with the order id tacked onto the query? A link's destination is fixed when you create it, and the link server doesn't copy extra query parameters from the tap into the destination. Per-order links also give you an expiry per order and a row per order in Analytics. Slugs can use letters, digits, - and _, up to 64 characters (Short links), so order ids fit. For a backfill, POST /v1/links/batch creates up to 500 links per call.

Mind the plan limits: Free allows 100 new links a month, which suits testing; Starter and up have no link limit, which per-order links need.

Using the second URL button

Two URL buttons let one message offer two destinations. A common pair is "Track order" and "Get help". Decide for each button whether it should open the app. The help button might go to a web page that works for anyone, logged in or not, while the order button opens the app.

If both buttons are deep links, give each its own link, for example order-48213 and return-48213, and its own utm_campaign or tag. Analytics then shows which button people used and whether each tap opened the app. Keep the variable rule in mind for both: each URL can end in one variable, so a two-button template that changes per order needs both URLs to end with the order part.

If you're moving an old template whose button pointed at a Firebase page.link address, those links lost their deep-link behaviour when Firebase Dynamic Links shut down: Google no longer opens the app from them, and some return 404. Paste them into the page.link checker to see what each pointed to before you rebuild the button.

Keep personal data out of the URL

The variable ends up in a URL that's visible in the message, in browser history and in server logs along the way. Use an order number or a random token, never a phone number, an email address or a name. The same goes for the destination: put the order id in the path and let the app fetch the details after the person signs in.

What happens when someone taps the button

Two things decide whether the tap opens your app.

Verified links. On Android, when WhatsApp hands a URL to the phone, Android checks whether an installed app has verified that domain. If your App Links are verified for your link domain, the app can open directly from the tap. iPhone does the same with Universal Links. Check both files for your link domain with the App Links checker.

WhatsApp's in-app browser. Some WhatsApp versions load links inside their own browser, which can't hand the tap to another app by itself. The link server recognises that browser. On Android it shows a short page with your app's name and an Open in app button, which opens the app at the deep link, or goes to Google Play with the link in the install referrer when the app isn't installed. On iPhone it explains how to open the link in Safari. You can see each decision in the Will it open my app? simulator with "WhatsApp, Android" picked.

We haven't recorded a template-button tap on a real phone yet. Buttons are rendered by WhatsApp, and how a button tap opens a URL may differ from a link in the message text, so test your own template before a big send.

People who don't have the app yet

A cart reminder often reaches someone who uninstalled the app. On Android, the tap goes to Google Play with the link in the install referrer, and the SDK reads it on the first open, so the new install lands on the order or cart instead of the home screen. That's exact: no guessing. On iPhone, the link page offers Get the app, and install matching on the first open is opt-in (how iPhone install matching works).

Give time-bound buttons an expiry

A payment link from last month shouldn't open a checkout today. Set expiresAt on per-order and per-offer links, and choose what an expired tap gets: a "This link has expired" page, the app store, or a web page you pick (When a link expires). Expired taps are recorded but never billed.

Counting button taps

With utm_source=whatsapp in the destination, button taps are filed under the whatsapp channel even when WhatsApp hands the tap to Chrome or Safari, and utm_campaign keeps order updates apart from offers. Analytics then shows taps, installs and app opens per campaign, and a purchase recorded in the app attaches to the tap that brought it (Analytics: how we count).

Meta's own template insights count messages and button taps on WhatsApp's side. The two numbers answer different questions: Meta's says how many people tapped the button, ours says where each tap went and whether the app opened.

A checklist before you submit the template

  • The button URL is your link domain, with the variable last: https://<handle>.strait.link/order-{{1}}
  • The example value you submit to Meta is a real test order with a live link
  • Your server creates the link before the message is sent, never after
  • The destination has utm_source=whatsapp and a campaign name (UTM builder)
  • Per-order links have an expiry
  • App Links verified for the link domain, and Universal Links if you ship on iPhone
  • Sent to your own number and tapped, with the app installed and without it

If a tap still opens a web page, the troubleshooting guide lists the checks in order.

Sources and how we checked

  • Meta for Developers, Template components: the two URL buttons, ten buttons in total, the 2,000-character limit and the single variable appended to the end of the URL.
  • Slug rules, batch creation, expiry and the channel order are from Strait's own docs and link engine code. The link server doesn't merge tap query parameters into the destination (engine code, October 2026).
  • The in-app browser decisions are the engine's, as shown by the simulator. We haven't tested a template button tap on a real phone; the Android deferred result is from our real-phone test with a Google Play internal testing build (October 2026).