# Deep-links

"Deep links" is the way to navigate the user through the built-in gamification functionality or to the screens specific to the integrated product.

**The built-in deep links** - in most cases are starting with "gf" prefix, for example, the **gf\_missions** deep link will navigate the user to the screen with a list of the missions.

**Product-specific deep links** - may have any kind of name, for example, a deep link with the name "cashier" can lead users to the deposit page.

{% hint style="info" %}
We are strongly encouraging to use of deep links instead of the fixed URLs as they are providing a unified way to lead users to specific screens no matter the channel used - deep links are working the same way for online communication, like Popups & Inbox, and for the offline, like Mails, SMS and Push notifications.

They are also simplifying operational work in the case of multi-brand usage because they are abstracted from the target domain on which a specific brand is set up.

And they can help you to migrate to a new domain, in in case a main domain got blocked or is not available for whatever reason.
{% endhint %}

Deep links can be executed from the main places in the Smartico system:

* From the Popup, Push messages, and Inbox messages
* From the SMS, you can build a message like "Try our new missions dp:gf\_missions", the deep link will be replaced dynamically at the time of the sending message and after clicking on the link, the user will land on the main site with the needed deep link executed. The same is working for other IMs like WhatsApp, Viber, Telegram, etc.
* From Mail templates, when building link like \<a href="dp:gf\_missions">Click here\</a>
* From the main site using javascript call *\_smartico.dp("dp:gf\_missions");*
* Directly by navigating to your site with specific parameters in the URL, e.g. <https://smartico.ai/#_smartico_dp=dp:gf_missions>&#x20;
* From the descriptions of missions, tournaments, mini-games, levels, etc. All places that are supporting HTML or have a dedicated place to put a deep link

### Deep-links in Mini Games

#### Open Mini Game in the Gamification widget <a href="#t5gvbd5efxtq" id="t5gvbd5efxtq"></a>

Mini games can be opened as part of Smartico Gamification widget using a Deep Link;

* <mark style="color:red;">dp:gf\_saw</mark> - will open the mini games section with 1st by priority game
* <mark style="color:red;">dp:gf\_saw\&id=19</mark> - will open specifically mini game template ID 19

#### Open Mini Game in standalone mode <a href="#vbowyhj0a4dx" id="vbowyhj0a4dx"></a>

Mini games can be opened in standalone mode directly on the operator site when the user clicks on a specific HTML element placed on the website.

* <mark style="color:red;">\_smartico.dp('dp:gf\_saw\&id=19')</mark> - will opened game with id 19 in the Gamification widget context
* <mark style="color:red;">\_smartico.miniGame(19)</mark> - will open Mini-game with id 19 in standalone mode

### List of deep links supported out of the box

<table data-full-width="true"><thead><tr><th width="279">Deep link</th><th width="408">Action</th><th width="137" data-type="checkbox">Standalone</th><th data-type="checkbox">Hide main</th></tr></thead><tbody><tr><td><strong>dp:gf</strong></td><td>Opens main screen of gamification widget</td><td>false</td><td>false</td></tr><tr><td><strong>dp:gf_activity</strong></td><td>Opens the "Inbox" section inside the gamification widget</td><td>false</td><td>true</td></tr><tr><td><strong>dp:inbox</strong></td><td>Opens separate "Inbox" widget, please refer to the <a href="../crm-automation/communication-channels/inbox">Inbox</a> article explaining the concept of this communication channel and widget</td><td>false</td><td>false</td></tr><tr><td><strong>dp:gf_missions</strong></td><td>Opens overview screen of missions</td><td>true</td><td>false</td></tr><tr><td><strong>dp:gf_missions&#x26;category=completed</strong></td><td><p>Opens one of 4 categories in the missions:</p><ul><li>overview</li><li>available</li><li>locked</li><li>completed</li></ul></td><td>true</td><td>false</td></tr><tr><td><strong>dp:gf_missions&#x26;id=123</strong></td><td>Opens missions with specific ID</td><td>true</td><td>true</td></tr><tr><td><strong>dp:gf_matchx</strong></td><td>Opens 'Match X' section</td><td>true</td><td>false</td></tr><tr><td><strong>dp:gf_matchx&#x26;id=123</strong></td><td>Opens a 'Match X' game with specific ID</td><td>true</td><td>false</td></tr><tr><td><strong>dp:gf_badges</strong></td><td>Opens badges screen</td><td>true</td><td>false</td></tr><tr><td><strong>dp:gf_board</strong></td><td>Opens leaderboards section</td><td>true</td><td>false</td></tr><tr><td><strong>dp:gf_board&#x26;type=2</strong></td><td><p>Open leaderboard of type Weekly, other types</p><ul><li>1 - Daily</li><li>2 - Weekly</li><li>3 - Monthly</li></ul></td><td>true</td><td>false</td></tr><tr><td><strong>dp:gf_tournaments</strong></td><td>Opens main tournaments screen</td><td>true</td><td>false</td></tr><tr><td><strong>dp:gf_tournaments&#x26;category=myTournaments</strong></td><td><p>Opens specific list of tournaments, possible values:</p><ul><li>all</li><li>inProgress</li><li>myTournaments</li><li>finished</li></ul></td><td>true</td><td>false</td></tr><tr><td><strong>dp:gf_tournaments&#x26;id=123</strong></td><td>Opens tournament lobby with defined id</td><td>true</td><td>false</td></tr><tr><td><strong>dp:gf_tournaments&#x26;id=123&#x26;register=true</strong></td><td>Opens tournament lobby with defined id and registers user in it</td><td>true</td><td>false</td></tr><tr><td><strong>dp:gf_tournaments&#x26;id=123&#x26;section=leaderboard</strong></td><td>Opens tournament leaderboard section </td><td>true</td><td>false</td></tr><tr><td><strong>dp:gf_bonuses</strong></td><td>Opens bonuses screen</td><td>true</td><td>false</td></tr><tr><td><strong>dp:gf_levels</strong></td><td>Opens level screen</td><td>true</td><td>false</td></tr><tr><td><strong>dp:gf_levels&#x26;id=123</strong></td><td>Opens level details with specified id</td><td>true</td><td>true</td></tr><tr><td><strong>dp:gf_saw</strong></td><td>Opens Spin The Wheel screen</td><td>true</td><td>false</td></tr><tr><td><strong>dp:gf_saw&#x26;id=123</strong></td><td>Opens Spin The Wheel screen with focus on the specific game template</td><td>true</td><td>false</td></tr><tr><td><strong>dp:gf_section&#x26;id=123</strong></td><td>Opens "custom section" with defined ID</td><td>true</td><td>false</td></tr><tr><td><strong>dp:gf_store</strong></td><td>Opens store screen</td><td>true</td><td>false</td></tr><tr><td><strong>dp:gf_store&#x26;category=123</strong></td><td>Open store screen with defined category</td><td>true</td><td>false</td></tr><tr><td><strong>dp:gf_store&#x26;id=456</strong></td><td>Open store item with defined id</td><td>true</td><td>true</td></tr><tr><td><strong>dp:gf_change_nickname</strong></td><td>Opens gamification widget with an interface to change nickname</td><td>false</td><td>true</td></tr><tr><td><strong>dp:gf_change_avatar</strong></td><td>Opens gamification widget with an interface to change avatar</td><td>false</td><td>true</td></tr><tr><td><strong>dp:action&#x26;action=START_X</strong></td><td>Triggers "Client action" event that can be used in campaigns, missions, automation rules .etc</td><td>false</td><td>false</td></tr></tbody></table>

### Standalone & hide\_main parameters

Most deep links related to gamification support "standalone" and "hide\_main" parameters.&#x20;

Adding "\&standalone=true" parameter to the deep link will lead to opening only a dedicated section of the gamification widget without the left menu and header. For example, "dp:gf\_missions\&standalone=true" will open the missions screen like in the screenshot below

<figure><img src="https://77049817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfS5hl0PiysHtKAKMsQTe%2Fuploads%2Fk1pulPFpVKes4A7bGfja%2FSmartico%20Gamifcation%20Demo%20for%20Casino%202023-03-13%2022-10-03.png?alt=media&#x26;token=e66ffceb-adaf-4140-908a-4af8e3a11e07" alt=""><figcaption><p>Missions in standalone mode</p></figcaption></figure>

Adding "\&hide\_main=true" to the deep link will focus on the specific element, usually identified with "id". For example, the deep link "dp:gf\_missions\&id=123\&hide\_main=true" will open a mission with id 123 in the focus.

<figure><img src="https://77049817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfS5hl0PiysHtKAKMsQTe%2Fuploads%2Fw1Gyg7qOnhG2AtNPeyVf%2FSmartico%20Gamifcation%20Demo%20for%20Casino%202023-03-13%2022-12-33.png?alt=media&#x26;token=4b718552-c0c0-43ca-8e17-5d09ef0d11ad" alt=""><figcaption><p>Mission opened with hide_main=true</p></figcaption></figure>

Similar way you can trigger the opening of the "Change avatar" interface or "Change nickname" interface ('dp:gf\_change\_avatar\&hide\_main=true' and 'dp:gf\_change\_nickname\&hide\_main=true')

<figure><img src="https://77049817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfS5hl0PiysHtKAKMsQTe%2Fuploads%2FyegGvIwVY7QeMD1mCFbA%2Fscreencast%202023-03-13%2022-14-22.gif?alt=media&#x26;token=5ac6f526-a260-4b6f-97e5-ed8ef8926e7a" alt=""><figcaption></figcaption></figure>

#### Mini-games specifics

Mini-games can be called in 3 different ways

* **dp:gf\_saw** - will open the main gamification widget with a focus on the Mini-games screen
* **dp:gf\_saw\&id=123** - will do the same, but will focus on specific game template
* **dp:gf\_saw\&id=123\&standalone=true** - will open mini-game in standalone mode, see screenshot below
* **dp:gf\_saw\&id=123\&standalone=true\&with\_games\_list=true** - will open mini-games in standalone mode, list all available games, and focus on template id 123

<figure><img src="https://77049817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfS5hl0PiysHtKAKMsQTe%2Fuploads%2FkrgzVZb5BNO6Aq9OujHZ%2Fimage.png?alt=media&#x26;token=e94753a7-3899-49e1-9de0-dd20c8da1205" alt=""><figcaption><p><strong>dp:gf_saw</strong></p></figcaption></figure>

<figure><img src="https://77049817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfS5hl0PiysHtKAKMsQTe%2Fuploads%2FF8LpV7s5oGF8VVKd1GEb%2Fimage.png?alt=media&#x26;token=044e0da2-0acb-4d09-8ffc-5d88bfc20235" alt=""><figcaption><p><strong>dp:gf_saw&#x26;id=123&#x26;standalone=true</strong></p></figcaption></figure>

<figure><img src="https://77049817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfS5hl0PiysHtKAKMsQTe%2Fuploads%2Fgq9gO5RwJneKa2vsVzkz%2Fimage.png?alt=media&#x26;token=2f84d275-eab8-412c-903b-02ce8a45e58f" alt=""><figcaption><p><strong>dp:gf_saw&#x26;id=123&#x26;standalone=true&#x26;with_games_list=true</strong></p></figcaption></figure>

### Implementing custom deep links

Smarico JS SDK can be extended with custom Deep Links, developed by Partner.&#x20;

An example of a custom Deep Link is “**dp:deposit\&amount=50\&method=PaySafe**” which could navigate users to the deposit page on the Partner side with a predefined amount and payment method.

Whenever such Deep Links are implemented they can be used from all the places of the Smartico system and communication resources as a unified way to control user flow.

In order to implement a custom deep link(s), the Partner needs to define a function named \_\_smarticoDPCustom. Example of implementation

```javascript
function __smarticoDPCustom(dp) {
    switch (dp.action) {
       case 'deposit' : {
           window.location.href = '/deposit/?amount=' + (dp.params.amount ? '&method=' + dp.params.method : '')
           break;
       }
       default: {
           return false
       }
   }
   return true;
}
```

As soon as deep links are implemented by Partner, they need to be registered on the Smartico side in order to be visible in all the places with auto-complete possibility.

<figure><img src="https://77049817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfS5hl0PiysHtKAKMsQTe%2Fuploads%2FGj9sXm2Q9oAMKjmePeYf%2Fsmartico.ai%202022-09-30%2012-08-02.png?alt=media&#x26;token=e0936940-bcd6-44ba-b038-898e63a69e7d" alt=""><figcaption></figcaption></figure>
