Construct Deeplink URL

A deeplink is a special kind of URL that allows you to link to a specific screen in the app. It is similar to a website URL, with these key differences:

  • instead of using http  or https , it uses a protocol that is unique to your app
  • it does not contain the domain of your website


In the following examples, we'll use hs as the protocol. Replace this with the protocol for your app (e.g. vince. for Vince, scotchsoda for Scotch & Soda). Contact our support if you're unsure what the protocol for your app is.


The app supports deeplinking to the following screens:

  • the home screen: hs://home
  • a category product lister: hs://categories/123  (replace 123  with the url encoded ID of the category)
  • a product lister with filters: hs://productlist?title={name_in_the_app}&category={category_id}&filters[0][attribute]={attribute_id}&filters[0][in][]={attribute_value} (see next section for details)
  • a product detail screen: hs://products/123  (replace 123  with the url encoded ID of the product)
  • the search screen: hs://search/query%20goes%here (note: the query at the end of the URL should be url encoded)
  • the favorites screen: hs://favorites
  • the lookbooks overview screen: hs://lookbooks 
  • the lookbook detail screen: hs://lookbooks/123  (replace 123  with the url encoded ID of a lookbook)
  • the cart: hs://cart 
  • the order history screen: hs://account/orders 
  • the loyalty vouchers screen: hs://account/vouchers 
  • a content extension: hs://contentextension/?url=aHR0cHM6Ly93d3cubWFybGllc2Rla2tlcnMuY29tL2VuLW5sL2ZpdHRpbmctcm9vbS5odG1s&title=fitting%20room  (note: the value of the url  parameter should be a base64-encoded url, the value of the title parameter should be url encoded)


Note for SFCC customers: If a product is a master product, it is better to use a variation ID instead of the master ID.


Deeplinks with Filters.

You can create deeplinks to a category with a filter. The user will be redirected to a new category with only products that correspond to those filters.


Example deeplink with filter:

hs://productlist?title={name_in_the_app}&category={category_id}&filters[0][attribute]={attribute_id}&filters[0][in][]={attribute_value}


Parameters

  • The title parameter will be the name of the resulting product list, that will be shown in the app. This parameter is optional, if omitted the name of the selected category will be shown.
    The title of the product list, will need to be url encoded. As you will see in one of the following examples a name as “Green and Blue” needs to be written as Green%20and%20Blue
  • The category parameter indicates the category on which the filter will be applied. This parameter is optional, if omitted the root category will be selected.
  • The first parameter filters[$i][attribute] describes the attribute being filtered on.
  • The additional parameters describe the acceptable value or values. At least one acceptable value is required: filters[$i][in][$j]=$value
    Filters are numbered, starting from 0 ($i). Acceptable values {value} are also numbered, starting from 0 ($j).


Example

  1. Example: Only returns Adidas products of size 2. This will apply this filter on category with id 2 and the resulting product list will have the name Adidas.

    hs://productlist?title=Adidas&category=2&filters[0][attribute]=brand&filters[0][in][]=ADIDAS&filters[1][attribute]=size&filters[1][in][]=2
  2. Example: Only return green or blue products. This will apply this filter on category with id 12 and the resulting product list will have the name Green and Blue.

    hs://productlist?title=Green%20and%20Blue&category=12&filters[0][attribute]=color&filters[0][in][0]=green&filters[0][in][1]=blue


How to test

The quickest way to get started with testing deeplinks is to use the browser on your device. Enter the deeplink in the address field of the browser and press Go. Assuming that the app is installed in the same device, then it will prompt you to open that page in the app. On iOS you can use Safari, on Android you can use Firefox (Chrome does not support this).


Some tips for when you're frequently testing deeplinks:

  • On iOS, type in the deeplinks in a Notes entry. You can simply tap on the link to trigger the deeplink. If your Notes sync with your mac, it might be easier to type in the deeplinks on there.
  • On Android, consider using a dedicated deeplink tester app, e.g. https://play.google.com/store/apps/details?id=org.thewheatfield.android.deeplinks&hl=en
  • To test the same links on both platforms, consider hosting a web page with the links you want to test.