UserID

User ID Setup Guide

Overview

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

  1. Your website generates or retrieves a userid for the current user

  2. Your website passes the userid to the game via URL parameter

  3. The user plays the game

  4. 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:


If your website already has a sign-up/login system, use the existing user identifier.

Examples:

  • Database user ID (e.g., 12345)

  • Username (e.g., james)

  • Email address (e.g., [email protected])

  • Registration number or member ID

Advantages:

  • Reliable user tracking across devices and sessions

  • Webhook data can be matched to your user database

  • No duplicate users


Option 2: Generate a Random ID (No Sign-up Required)

If your website does not have a user system, you can generate a unique ID and store it in the browser.

Advantages:

  • No sign-up system needed

  • Quick to implement

  • Returning users keep the same ID

Limitations:

  • If the user clears browser data or uses incognito mode, a new ID is generated

  • Cannot track the same user across different devices or browsers

  • Not suitable when accurate user identification is required


Webhook Response Data

After each game play, the following data is sent to your Webhook URL via POST:

Parameter
Description
Example

userid

Unique user identifier sent by your system

james or f47ac10b-58cc...

tx_id

Unique transaction ID for each game play

234234

time

Date and time when the user played the game

2025-04-10 06:39:23

score

Score the user achieved

3500

playtime

Play duration in seconds

20

Return Code

Your server must return one of the following codes after receiving the webhook:

Code
Description

S

Success

F

Failure. You may include a reason, e.g., F: Score is missing.


Which Option Should I Choose?

Option 1: Existing User System
Option 2: Random ID

Best for

Loyalty programs, rewards, personalized experiences

Promotions, contests, casual engagement

User tracking

Accurate, cross-device

Browser-only, may create duplicates

Implementation

Requires existing auth system

Simple, no backend needed

Webhook data matching

Can match to your user database

Limited to browser session


Integration with WordPress

If your website runs on WordPress, you can automatically pass the logged-in user's ID to the game iframe using plugins.

Plugin
Description

Supports url_forward_parameter to forward URL parameters to the iframe

Automatically appends URL parameters to any iframe with id="rwcGetParams"

Example: Passing WordPress User ID

Add this to your theme's functions.php to create a shortcode that outputs the game iframe with the current user's ID:

Then use the shortcode in any page or post:


Integration with Auth Services (No Existing User System)

If your website does not have a user system, you can use a third-party authentication service to add signup/login and obtain a user ID.

Service
Features
Free Tier

Embeddable signup/login components, social login, instant user.id

Up to 10,000 MAU

Google/social login widget, uid per user, JS SDK

Unlimited free

Open-source, email/social/magic link login, user.id via JS SDK

50,000 MAU free

Universal Login widget, social login, Management API

Up to 25,000 MAU

Example: Firebase Auth

Example: Supabase Auth

Which Service Should I Choose?

Clerk
Firebase Auth
Supabase Auth
Auth0

Easiest setup

Best

Good

Good

Moderate

Pre-built UI

Yes (React, JS)

Yes (FirebaseUI)

No (build your own)

Yes (Universal Login)

Social login

Google, GitHub, etc.

Google, Facebook, etc.

Google, GitHub, etc.

60+ providers

Best for

React/Next.js sites

Any website

Developers wanting open-source

Enterprise needs

Last updated