When using the UserID & Webhook campaign type, your system must send a unique userid value to identify each game player. This userid is included in the webhook data sent back to your server after each game play.
How It Works
Your website generates or retrieves a userid for the current user
Your website passes the userid to the game via URL parameter
The user plays the game
Our system sends the game result (including the userid) to your Webhook URL
Your Website Branded Mini-Games
| |
|-- userid (via URL parameter) --------->|
| | User plays the game
|<-- Webhook POST (userid + result) -----|
Passing the User ID
Add the userid parameter to the game URL when embedding it on your website:
Option 1: Using Your Existing User System (Recommended)
If your website already has a sign-up/login system, use the existing user identifier.
<!-- Example: HTML / JavaScript -->
<iframe id="game-frame" width="100%" height="600" frameborder="0"></iframe>
<script>
const userId = getCurrentUser().id; // from your auth system
document.getElementById('game-frame').src =
`https://branded.mini-games.io/?php=landing@game&campaign_no=43292&userid=${userId}`;
</script>
// Generate or retrieve userid
let userid = localStorage.getItem('game_userid');
if (!userid) {
userid = crypto.randomUUID();
// e.g., "f47ac10b-58cc-4372-a567-0e02b2c3d479"
localStorage.setItem('game_userid', userid);
}
// Set the game iframe URL
document.getElementById('game-frame').src =
`https://branded.mini-games.io/?php=landing@game&campaign_no=43292&userid=${userid}`;