# Deep Linking

Some teams choose to create custom deep linked buttons above their menus to help direct their shoppers to specific brands or categories Table of Contents

### Table of Contents

[What is Deep Linking](#what-is-deep-linking)

[Create & Send Your Deep Links](#create-and-send-your-deep-links)

[Create Links that Auto-Fill Promo Codes](#create-links-that-auto-fill-promo-codes)

[Deep Linking through a Jane Subdomain](#deep-linking-with-a-jane-subdomain-page)

[Deep Linking with a Location Based Menu (Operator Embed)](https://docs.iheartjane.com/new-jane-roots-docs/embeds/prefiltering-operator-embed-menus)

[Troubleshooting Deep Linking](#troubleshooting-deep-linking)

## What is Deep Linking?

Deep linking allows you to send your customers to a pre-filtered version of your menu as opposed to the menu as a whole.

#### Instances you may want to use deep linking:

* Brand spotlights
* Highlight specific categories
* Promotions or sales on products
* Help customers find products tied to a specific query or search term
* Autofill a Jane Promo Code to avoid manual entry at checkout

#### **Jane offers a few different menu types**

#### [For information on deep linking through a Jane Subdomain page, click here.](/partner-success/men-you/deep-linking.md#deep-linking-with-a-jane-subdomain-page)

#### [For information on deep linking through a Jane Location Based menu page, click here.](https://docs.iheartjane.com/docs/operator-embed-query-params)

## Create & Send your Deep Links

Creating your deep links just takes a few simple steps!

1. Use your Jane menu template to create your filtered view
2. Attach the filtered URL to your store's menu page
3. Send your campaign out!

Let's go through those steps more in-depth together!

To find your Jane menu template, go to the URL below and replace "storeid" with your Jane store id

[iheartjane.com/embed/storeid/menu](https://www.iheartjane.com/embed/stores/1234/menu)

Once on this page, you can simply filter your menu down to what you'd like to direct folks to see. The URL will update with your filters like:

[www.iheartjane.com/embed/stores/111/](http://www.iheartjane.com/embed/stores/111/)<mark style="color:orange;">menu?refinementList%5Broot\_types%5D%5B0%5D=sale</mark>&#x20;

Then, you'll simply copy the end of the URL and paste that to end of your store's menu page with `?path=` added to your URL, so the final product will look like:

[www.mystoremenu.com/](http://www.mystoremenu.com/)<mark style="color:green;">?path=</mark><mark style="color:orange;">menu?refinementList%5Broot\_types%5D%5B0%5D=sale</mark>&#x20;

Here's a quick video to walk you through this process as well!:

{% embed url="<http://videos.iheartjane.com/watch/BqGrknMK6mnBRiPwdkcyvs>" %}

## Create Links that Auto-Fill Promo Codes

Automate the rewards process for your customers by having promo code deals automatically get filled in through your links. [For a guide on setting up your promo codes, check this page out.](https://docs.iheartjane.com/partner-success/deals-and-specials/you-are-special)

You can do this by adding the following to the end of your menu page on your website:

?promo\_code=YOURCODEHERE

for example, if my promo code is 25OFF my URL would look like:

[www.mystoremenu.com/?promo\\\_code=25OFF](http://www.mystoremenu.com/?promo\\_code=25OFF)

Here's a quick video of how this will appear for your customers:

{% embed url="<http://videos.iheartjane.com/watch/GfSc7u8QHZpk9KNs5EvTBQ>" %}

## Deep Linking with a Jane Subdomain Page&#x20;

If you are using a Jane Subdomain, there is no setup for deep linking!&#x20;

You can simply filter your page to the desired view, your URL will change up top, and you can use this for your links. Here's a quick gif of how this works.

An example of linking to a specific query (Cherry) and linking to a specific product:

![](/files/-MggMQJ_oDwBdCbcPv_j)

Is this making you want a subdomain? Learn about setting one up for free here: [🛳 Subdomains and Jane](/partner-success/men-you/subdomains-and-jane.md)

## Troubleshooting Deep Linking

1. [Check your embed script with the information below](#checking-your-jane-embed-script)
2. Sometimes for more complex queries (deep linking to a category and a brand) different website code on your site overlays the queries in the URL and rejects the additional special characters. [You can use a guide like this one](https://www.obkb.com/dcljr/charstxt.html) to substitute out the `&` with `%26` OR changing = to %3D

   1. for example this URL: \
      examplemenu.com/?path=menu?refinementList%5Broot\_types%5D%5B0%5D=ediblel<mark style="color:purple;">&</mark>refinementList%5Bbrand%5D%5B0%5D<mark style="color:orange;">=</mark>Cheeba%20Chews\
      \
      would become: \
      examplemenu.com/?path=menu?refinementList%5Broot\_types%5D%5B0%5D=edible<mark style="color:purple;">%26</mark>refinementList%5Bbrand%5D%5B0%5D<mark style="color:orange;">%3D</mark>Cheeba%20Chews

#### Checking your Jane embed script

If you've been with Jane for a bit, you might need to update your menu embed code with the attached version to make sure your menu will be compatible for deep linking.&#x20;

If you need any help with this, please reach out to us at <partnersuccess@iheartjane.com> and our team can help!

{% hint style="danger" %}
Replace the embed code on your website with the code attached below. Please note you will want to replace both spots listed as “store\_id” with your store id.
{% endhint %}

<pre class="language-html" data-line-numbers><code class="lang-html">&#x3C;script id="jane-frame-script" 
    src="https://api.iheartjane.com/v1/stores/STORE_ID/embed.js">
&#x3C;/script>
&#x3C;script>
  var getParams = function (url) {
    var params = {};
    var parser = document.createElement('a');
<strong>    parser.href = url;
</strong>    var query = parser.search.substring(1);
    var vars = query.split('&#x26;');
  
    for (var i = 0; i &#x3C; vars.length; i++) {
      var pair = vars[i].split('=');
    
      if(pair.length > 2) {
        params[pair[0]] = decodeURIComponent(pair[1] + '=' + pair[2]);
      }
      else {
        params[pair[0]] = decodeURIComponent(pair[1]);
      }
    }
  
    if(params['path']){
      params['path'] = params['path'].replace("path=","");
    }
<strong>    return params;
</strong>  };
  
  var baseURL = "https://www.iheartjane.com/embed/stores/STORE_ID/";
  var params = getParams(window.location.href);
  if(params['path']){
    var newSrc = baseURL + params['path'];
    if (params['promo_code']) {
      newSrc = newSrc + '&#x26;promo_code=' + params['promo_code'];
    }
  document.getElementById('jane-menu').src = newSrc;
}
&#x3C;/script>
</code></pre>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.iheartjane.com/partner-success/men-you/deep-linking.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
