> For the complete documentation index, see [llms.txt](https://help.smartico.ai/welcome/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.smartico.ai/welcome/products/vibe-studio/navigating-players-to-promotion-and-landing-pages.md).

# Navigating players to Promotion and Landing pages

When you are ready with your Landing or Promotional page and are ready to publish it on your own domain, you need to make a few final changes. After you publish, **Get link** in the Vibe Studio toolbar shows the page's address.

## Prepare index.html (needed for Promotions and Landings)

Your template's index.html file only needs to contain the %SMARTICO\_INIT\_SCRIPT% placeholder. When you publish the page, Vibe Studio automatically provides the label key and chosen brand key, so you do not need to configure keys in the code.

Your final index.html should look like this:

{% code title="index.html" %}

```html
<html>
<head>
...
</head>
<body style="margin:0">
  <div id="root"></div>
  <script type="module" src="/index.tsx"></script>
  <!-- DO NOT REMOVE SMARTICO_INIT_SCRIPT from this page -->
  %SMARTICO_INIT_SCRIPT%
</body>
</html>
```

{% endcode %}

**Important:** do not remove %SMARTICO\_INIT\_SCRIPT% from the page.

For Landing pages, you can set the language by passing the parameter `?_smartico_language=br` in the URL. Promotion pages automatically display the logged-in player's preferred language.

## Choose the brand when you publish

When publishing a Landing or Promotion page on a label with multiple brands, the publish dialog asks: "Which brand is this page for?".

You must select the relevant brand before publishing. If your label has only one brand, it is used automatically.

Because the page opens on your own domain without URL query parameters, it must know which brand's settings, visitor mode, and gamification profile to use. If visitor mode is not configured for the chosen brand on a Landing page, the dialog displays a warning. Subsequent publishes pre-select the brand that was last used.

## Enabling visitor mode (for Landings only)

Be sure you have visitor mode enabled on your label/brand.

Follow the guide in the section **'Enabling Visitor mode in Smartico'** described in the [Visitor mode](https://help.smartico.ai/welcome/technical-guides/front-end-integration/visitor-mode.md).

## Passing 'User ID' in the URL (for Promotions only)

You need to pass the user's ID to the promotion page; this way, the page will know which gamification profile to load. The format of the URL should look like the following:

{% code title="" %}

```
https://summer-tournament.mycasino.com/?_smartico_user_ext_id=XXX
```

{% endcode %}

Where XXX is the user identifier in your system aligned with Smartico.

If your user's ID is impossible to guess, as in the screenshot below, this should be enough in most cases.

<div data-with-frame="true"><figure><img src="https://77049817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfS5hl0PiysHtKAKMsQTe%2Fuploads%2Fgit-blob-d65ff7d18339a73538d0d563d901a368fd19ec1d%2F0e614398eb-crop-1-8bd5e28a-4280cb.png?alt=media" alt="" width="563"><figcaption></figcaption></figure></div>

Otherwise, you need to enable hash protection logic in Smartico BackOffice and pass the user's hash, calculated on the server side.

### **The user\_hash should be calculated in the following way**

```
const hashValidityTimestampMs = ~~(+new Date() / 1000) * 1000 + 24 * 3600 * 1000;
user_hash = Md5.init((user_ext_id + ":" + "label_salt_key" + ":" + hashValidityTimestampMs).toLowerCase()) + ":" + hashValidityTimestampMs;
```

The label salt key can be retrieved from the label configuration in Smartico BackOffice. The hash validity timestamp is the moment (in milliseconds since 1970, UTC) until which the hash is valid - in the formula above, 24 hours from now.

Example of calculation:

```
label_key = 3ff6261b-00a7-4137-9906-de7450fd61c9
brand_key = 13d7ff00
user_ext_id = 879978
label_salt_key = demo-salt
timestamp = 1638050700000 // Sat Nov 27 2021 22:05:00 GMT+0000
user_hash = 019b370929095f0cfe6c9b02ea7524a2:1638050700000

```

After calculating the hash, you will need to pass it in the URL

{% code title="" %}

```
https://summer-tournament.mycasino.com/?_smartico_user_ext_id=XXX&_smartico_user_hash=YYY
```

{% endcode %}

### Building a link to the promo page from emails, push, popups, etc

You can build a navigation link as part of any communication channel in the Smartico CRM,

The link should be formed using the following tags:

```
?_smartico_user_ext_id={{state.user_ext_id_clean}}&_smartico_user_hash={{state.user_hash|24}}
```

Pay attention to the parameter "24", it defines how long the hash will be valid, in hours (24 is also the default when you leave it out). If the mail with such a link is sent to the end user, they will be able to follow it for only 24 hours.

Example of email template with the link:

```html
<div>
Hello user, 
Check your progress in the
<a href="https://summer-tournament.mycasino.com/?_smartico_user_ext_id={{state.user_ext_id_clean}}&_smartico_user_hash={{state.user_hash|24}}"> 
Summer Tournament
</a>
</div>
```

## Sending players of another brand or label

By default, published pages use the brand chosen during publishing. You can override the brand or label dynamically using URL query parameters:

* `_smartico_brand_public_key`: Send players belonging to another brand under the same label to the page. The link value overrides the brand chosen at publish time.
* `_smartico_label_public_key`: Point the page to a different label. **Important Rule:** Whenever you pass a label key, you must always pass the corresponding brand key (`_smartico_brand_public_key`) of that label as well. Passing a label key alone will pair with the page's default brand and fail.

### Precedence Order

The page evaluates keys in the following order of precedence:

1. Keys set in code directly on the window object (`window._smartico_...`)
2. Keys passed in URL query parameters
3. Keys built into the page during publishing

For language on Landing pages, the URL parameter `_smartico_language` takes highest priority, followed by code assignments, falling back to English (`en`).

## Upgrading pages built with the earlier version of this guide

If an existing page's `index.html` has a script block setting `_smartico_label_public_key`, `_smartico_brand_public_key`, or `_smartico_language`, remove that entire `<script>` block so only `%SMARTICO_INIT_SCRIPT%` remains, then publish again and choose the brand.

Keys belonging to another label will block publishing until removed.

If you specifically require fixed keys in code, the only valid format is placing them on the window object directly above `%SMARTICO_INIT_SCRIPT%`:

```html
<script>
  window._smartico_label_public_key = 'YOUR_LABEL_KEY';
  window._smartico_brand_public_key = 'YOUR_BRAND_KEY';
</script>
```

Hard-coded keys on the window object override the brand chosen at publish time and any keys passed in URL links.

## Custom games and widgets

Custom games and embedded widgets do not require URL link parameters or key setup:

* [**Custom games**](https://help.smartico.ai/welcome/products/vibe-studio/custom-games.md)**:** Opened and authenticated automatically inside the operator website by the Smartico gamification interface.
* [**Widgets**](https://help.smartico.ai/welcome/products/vibe-studio/widgets.md)**:** Embedded on the operator's website using the embed code from Vibe Studio (**Get Code**) and use your site's existing Smartico initialization.

### FAQ

**Q: Why does the publish dialog ask for a brand on Landing and Promotion pages?**

A: Standalone pages on your domain load without parameters in the URL, so the page must know which brand's settings, visitor mode, and gamification configuration to use.

**Q: Can I send players from a different brand to the same landing or promotion page?**

A: Yes. Pass `&_smartico_brand_public_key=BRAND_KEY` in the URL link. The parameter in the link overrides the brand chosen when publishing.

**Q: Do Custom Games need URL parameters or link configuration?**

A: No. Custom games are launched directly from within the Smartico gamification widget, which passes player credentials automatically.

**Q: What if visitor mode is not configured for the chosen brand?**

A: Ensure visitor mode is enabled in your brand or label settings in Smartico Back-Office before publishing a landing page for that brand.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.smartico.ai/welcome/products/vibe-studio/navigating-players-to-promotion-and-landing-pages.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
