DEV Community

Marrakech Transport
Marrakech Transport

Posted on

WhatsApp Deep Links That Actually Work: Lessons from a Morocco Transfer Booking Site

#ux

When we built navetteforyou.com — a private transfer booking site for Marrakech, Morocco — we needed WhatsApp to be the primary booking channel. Not a form. Not email. WhatsApp.

Here is what we learned about making WhatsApp deep links work reliably across every device and browser.

The Problem

WhatsApp offers a "Click to Chat" API: https://wa.me/PHONE?text=MESSAGE. Simple, right?

Not quite. We hit three issues in production:

  1. Phone format matters. The number must be digits only — no plus sign, no spaces, no dashes. 212701664704 works. +212 701 664 704 does not.
  2. Pre-filled text encoding. Special characters in the message body break on some Android WebViews unless you use encodeURIComponent().
  3. Context tagging. When you run multiple websites through one WhatsApp number, you need to know which site a message came from.

Our Solution

We built a tiny utility that every CTA on the site calls:

const WHATSAPP_NUMBER = "212701664704";
const SITE_HOST = "navetteforyou.com";
const SOURCE_TAG = `[${SITE_HOST} · Marrakech Transport]`;

function tagged(text: string): string {
  return text.startsWith(SOURCE_TAG) 
    ? text 
    : text ? `${SOURCE_TAG}\n${text}` : SOURCE_TAG;
}

export function whatsappHref(text: string): string {
  return `https://wa.me/${WHATSAPP_NUMBER}?text=${encodeURIComponent(tagged(text))}`;
}
Enter fullscreen mode Exit fullscreen mode

Every WhatsApp link on the site opens with [navetteforyou.com · Marrakech Transport] followed by whatever context the user was looking at — the route, the vehicle, the date.

Why This Works Better Than a Form

For our market (airport transfers in Morocco), the conversion difference was stark:

  • Response time: WhatsApp messages get answered in minutes. Form submissions sit in an inbox.
  • Trust: Customers see a real person replying. In a market where trust matters (you are pre-paying for a driver to meet you at an airport in a foreign country), that human touch closes the deal.
  • Mobile-first: 90%+ of our traffic is mobile. WhatsApp is already on every phone. No app install, no account creation.
  • Multilingual: The office handles Arabic, French, English, and Spanish. WhatsApp auto-detects the keyboard language. No i18n needed on the chat side.

Technical Details

The wa.me domain handles the redirect to either:

  • WhatsApp Web (desktop browsers)
  • The native WhatsApp app (mobile)
  • A prompt to install WhatsApp (if not installed)

We tested across iOS Safari, Chrome Android, Samsung Internet, Firefox, and Edge. The encodeURIComponent wrapper is essential — without it, Arabic text in the pre-filled message breaks on Chrome Android.

The Source Tag Pattern

The SOURCE_TAG pattern deserves its own mention. We operate multiple websites (a sister site for Casablanca airport transfers, the main operator site at serenitymoroccotours.com). Every site tags its WhatsApp messages differently, so the office knows at a glance which site generated the inquiry.

This is a free, zero-dependency CRM signal. No integrations needed.

Takeaway

If your audience lives on WhatsApp (true for most of Africa, the Middle East, South Asia, and Latin America), skip the contact form. Build a proper wa.me deep link with:

  1. Digits-only phone number
  2. encodeURIComponent on the message
  3. A source tag for multi-site attribution

It took us one utility function and zero external dependencies.


We built navetteforyou.com as a static site with dynamic pricing quotes, serving Marrakech and all of Morocco. The entire booking flow runs through WhatsApp — reach us at +212 701 664 704.

Top comments (0)