Linking
Linking is only available to early access partners. Apply here to join the early access program.
The Shop app has built-in support for deep links, universal links (iOS) and app links (Android). Using this feature, you can create links that send users directly into your Shop Mini to drive increased adoption and growth.
Link format
https://shop.app/mini/<mini_handle>?shop_id=<shop_id>&product_id=<product_id>&product_variant_id=<product_variant_id>&order_id=<order_id>Example: https://shop.app/mini/hello-world?shop_id=123&product_id=456&product_variant_id=789&order_id=123456
Params
Param | Required | Description |
---|---|---|
mini_handle | Yes | Your Shop Mini's handle. |
shop_id | No | A shop identifier (integer). Depending on your Shop Mini's functionality this param might actually be required. |
product_id | No | A product identifier (integer). Depending on your Shop Mini's functionality this param might actually be required. |
product_variant_id | No | A product variant identifier (integer). Depending on your Shop Mini's functionality this param might actually be required. |
shop_domain | No | A shop's domain (string). Depending on your Shop Mini's functionality this param might actually be required. |
order_id | No | An order identifier (integer). Depending on your Shop Mini's functionality this param might actually be required. |
Knowing when the user opened your Shop Mini via a link and accessing params
To fetch the metadata regarding how the logged user opened your Shop Mini, you can import the hook from useMinisParams
from @shopify/shop-minis-platform-sdk
.
const {entryPointParams, entryPoint} = useMinisParams()
// entryPointParams attributes will match the query params of the link:
console.log(entryPointParams)
// if the link "https://shop.app/mini/hello-world?shop_id=123&product_id=456&product_variant_id=789" was used:
// { shopGID: 'gid://shopify/Shop/123', productGID: 'gid://shopify/Product/456', productVariantGID: 'gid://shopify/ProductVariant/789'}
console.log(entryPoint)
// entryPoint will be null when the mini was opened via a link
Browser preview
For users without the app installed this link will load a landing page in the web browser referencing your Shop Mini, and the merchant if the shop_id
param is present. This landing page will prompt users to download the Shop app as well.