Loading MatchX & Quiz games on website
Last updated
Last updated
You can see examples of embedding MatchX and other gamification components on this demo page - https://expo.smartico.ai
You can show MatchX as overlay popup on top of your web site.
This can be done by calling deep-link from the javascript
MatchX game can be shown as part of the existing 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
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
Please note that if the 'width' of the div is 576px or less, the rendered UI will be adjusted for mobile devices.
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.
To apply a custom theme to Match X in an iframe, you should pass the theme as a parameter along with the theme name -> ‘theme-name’.
This parameter is optional if you want to use a custom Match X theme or one of our built-in themes (dark or light). Otherwise, Match X will use Smartico’s default colors.
Example: