> 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/~/changes/B87CND5z8x8BAzJwmSVQ/products/mini-games/matchx-game/loading-matchx-game-as-part-of-your-website.md).

# Loading MatchX game as part of your website

MatchX game can be shown as a separate page on your main website

You need to create an empty IFRAME element and set it specific to your design height and width styles.

As soon as the player is authorized you can make a JavaScript call

```javascript
_smartico.miniGame(362, { 
    iframe:'match-x-game',
    zoom: 1,
    height: 'auto'
});.
```

* The first argument is the ID of the MatchX game template (you can have multiple).
* The second argument is a set of parameters:
  * iframe - id of the IFRAME element, where the game will be shown.
  * zoom - optionally gives a possibility to zoom in/out the UI of the game
  * height - can be set to 'auto' or to fixed height in pixels, e.g. '500px'. It's recommended to set the value to 'auto' for desktop users and to the fixed height on mobile devices. This approach will provide the best UX.

Example of the HTML/JavaScript code

```html
<iframe id='match-x-game' style='width: 100%; height: 0px; display: none'>
</iframe>
<script>
    _smartico.miniGame(362, { iframe:'match-x-game', zoom: 1, height: 'auto'} );
</script>
```

Please note that if the 'width' of the div is 576px or less, the rendered UI will be adjusted for mobile devices.&#x20;

{% hint style="danger" %}
Please note that at the time of the call to smartico.miniGame, the Smartico script should be already loaded. Otherwise, you will get an exception that \_smartico is undefined.

If you don't have good control from the JavaScript when \_smartico script is loaded, you can use the code below to trigger the game without exception.
{% endhint %}

```javascript
<script>
var miniGameInterval = setInterval(function() {
    if (window._smartico && document.getElementById('match-x-game')) {
        _smartico.miniGame(362, { iframe:'match-x-game', zoom: 1, height: 'auto'} );
        clearInterval(miniGameInterval);
    }
}, 10)
</script>
```

You can see more examples of embedding MatchX and other gamification components on this demo page:

<https://demo.smartico.ai/tests/landing-demo-inline-w.html>[ ](https://demo.smartico.ai/tests/landing-demo-inline-w.html)


---

# 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 dynamically by asking a question.

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

```
GET https://help.smartico.ai/welcome/~/changes/B87CND5z8x8BAzJwmSVQ/products/mini-games/matchx-game/loading-matchx-game-as-part-of-your-website.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
