# Deep links for e-commerce apps

> Link email, ads, packaging and posts to the exact product in your shopping app, and compare promotions by clicks and installs.

Page: https://warplink.app/use-cases/ecommerce-app-links

A shopping app needs links that land on one product, one collection or one cart, not on a home screen. Create a WarpLink link per product or promotion, put it in email, ads, packaging and social posts, and shoppers without the app go through the store and still reach the same product.

## How it works

1. **Link to the product, not the home screen.** Create a link for each product, collection or offer, with the destination set to that screen. Add the web page as the fallback for desktop visitors.
2. **Use your own domain in email.** Run order, restock and cart reminder emails through links on your own domain, so the tap can open the app. Check that your email provider does not rewrite them to a tracking address.
3. **Print a code on the box.** Put a QR code on packaging, inserts and shelf cards that encodes a WarpLink link. Change the destination later, for example to a reorder screen, without reprinting.
4. **Tag each placement.** Set utm_source, utm_medium and utm_campaign on each link, so the same names appear in your web analytics and in the WarpLink report.
5. **Carry the product through the install.** With the SDK in your app, a shopper who installs after tapping lands on the product on first launch. Keep a plain home screen for everyone else.
6. **Compare promotions by installs.** The link report shows clicks, unique clicks and installs per link. Export click rows as CSV to bring them into your own reporting.

## Create a product link on your domain

### REST API (TypeScript)

```typescript
// One link per product. A shopper with the app lands on the product screen.
const response = await fetch("https://api.warplink.app/v1/links", {
  method: "POST",
  headers: {
      // API key from Keys > API
      Authorization: "Bearer wl_live_YOUR_API_KEY",
      "Content-Type": "application/json",
    },
  body: JSON.stringify({
    app_id: "3f9a1c2e-6b7d-4e1a-9c2f-8a5b1d0e7c44",
    slug: "trail-runner-2-black",
    destination_url: "https://shop.example/products/trail-runner-2?color=black",
    ios_fallback_url: "https://apps.apple.com/app/id000000000",
    android_fallback_url: "https://play.google.com/store/apps/details?id=com.example.shop",
    tags: ["product", "footwear"],
  }),
});

const link = (await response.json()) as { short_url: string };
```

### REST API (TypeScript)

```typescript
// A cart reminder link on your own domain, tagged for the campaign.
const response = await fetch("https://api.warplink.app/v1/links", {
  method: "POST",
  headers: {
      // API key from Keys > API
      Authorization: "Bearer wl_live_YOUR_API_KEY",
      "Content-Type": "application/json",
    },
  body: JSON.stringify({
    app_id: "3f9a1c2e-6b7d-4e1a-9c2f-8a5b1d0e7c44",
    domain: "go.shop.example",
    slug: "cart-reminder-2h",
    destination_url: "https://shop.example/cart",
    utm_source: "email",
    utm_medium: "cart-reminder",
    utm_campaign: "winter-sale",
    tags: ["cart", "winter-sale"],
  }),
});

const link = (await response.json()) as { short_url: string };
```

## What you get

- **Linking.** Product, collection and offer links that open the right screen in the app, or the store page, or the web page, from email, ads, packaging and posts.
- **Attribution.** Installs that follow a tap on a WarpLink link, in any channel, are matched back to the promotion that drove them.
- **Analytics.** Clicks, unique clicks and installs per product or promotion, with device, country and referrer, plus CSV export.

## Questions

### Can one link open a specific product in the app?

Yes. Set the destination to the product screen. A shopper with the app is taken to it, and a shopper without it goes to the store page and then to the product on first launch.

### Can I use these links in marketing email?

Yes. Use a link on your own domain and make sure your email provider leaves it unwrapped, or tracks clicks on a domain you control.

### Can I change a QR code on packaging after printing?

Yes. The code holds the short link. Edit the link's destination in the dashboard and the printed code follows.

### How do I compare two promotions?

Give each promotion its own link or its own utm_campaign value. The Analytics page shows clicks and installs for each, side by side.

### Can I use the same links in ads and on social?

Yes. A link works wherever a URL does. Give each placement its own link or its own utm_campaign value, and the report keeps them apart.

## Related

- [Email deep linking](https://warplink.app/blog/email-deep-linking)
- [QR codes and deep linking](https://warplink.app/blog/qr-code-deep-linking)
- [Email to app](https://warplink.app/use-cases/email-to-app)
- [QR code to app](https://warplink.app/use-cases/qr-code-to-app)
- [Campaign attribution for apps](https://warplink.app/use-cases/campaign-attribution-for-apps)
