Webhook
PC and Mobile
Webhook Integration
Overview
When using the UserID & Webhook campaign type, game results are not displayed on an in-game leaderboard. Instead, the results are sent directly to your server via a webhook POST request.
This allows you to collect game data in real time and integrate it with your own system — whether that's a database, CRM, analytics platform, or even a simple Google Sheet.
How It Works
Your website embeds the game with a
useridparameterThe user plays the game
Upon completion, our system sends the game result to your Webhook URL via POST
Your server processes the data and returns a status code
Your Website Branded Mini-Games
| |
|-- userid (via URL parameter) --------->|
| | User plays the game
|<-- Webhook POST (game result) ---------|
| |
|-- Return "S" (success) --------------->|
URL Parameter
Append the userid as a GET parameter when embedding the game:
For details on generating and managing user IDs, see the User ID Setup Guide.
Webhook Data
The following parameters are sent to your Webhook URL via POST:
userid
Yes
Unique user identifier sent by your system
T4g4fLTa
tx_id
Yes
Unique transaction ID for each game play
234234
time
Yes
Date and time when the user played the game
2025-04-10 06:39:23
score
Yes
Score the user achieved
3500
playtime
Yes
Play duration in seconds
20
Data Format
You can choose the data format in the Studio settings:
default — standard form POST (
application/x-www-form-urlencoded)json — JSON format (
application/json)
Return Code
Your webhook endpoint must return a status code to confirm receipt:
S
Successfully received and processed
F
Failed. You may include a reason, e.g., F: Score is missing.
Server-Side Example (Node.js)
Google Sheets Integration (No Server Required)
If you don't have a backend server, you can use Google Apps Script to receive webhook data directly into a Google Sheet. This is ideal for promotions, contests, or quick setups.
Step 1: Create a Google Sheet
Go to Google Sheets and create a new spreadsheet
In the first row, add headers:
Received
userid
tx_id
time
score
playtime
Step 2: Open Apps Script
In your Google Sheet, go to Extensions > Apps Script
Delete any existing code and paste the following:
Click Save (Ctrl+S / Cmd+S)
Step 3: Deploy as Web App
Click Deploy > New deployment
Click the gear icon and select Web app
Configure the settings:
Description
Webhook receiver
Execute as
Me (your Google account)
Who has access
Anyone
Click Deploy
Authorize the app when prompted (review permissions and allow)
Copy the Web app URL — this is your Webhook URL
The URL looks like:
https://script.google.com/macros/s/AKfycb.../exec

Step 4: Set the Webhook URL in Studio
Go to your campaign's UserID & Webhook settings
Paste the Web app URL into the Webhook URL field
Set Result data format to json
Click Update the URL information
Important Notes
Result data format must be set to
json— Google Apps Script'sJSON.parse(e.postData.contents)expects JSON format. If set todefault, the data will not be parsed correctly.Re-deploy after code changes — Every time you edit the Apps Script code, you must create a New deployment (not just save). The URL changes with each new deployment, so update the Webhook URL in Studio accordingly.
Google account permissions — The script runs under your Google account. The first deployment requires authorization to access your Google Sheets.
Rate limits — Google Apps Script has a daily quota (approximately 20,000 requests/day for free accounts). For high-traffic campaigns, consider a dedicated server instead.
Response time — Apps Script may have a slight delay (1-3 seconds). This does not affect the game experience, as the webhook is sent asynchronously after the game ends.
Data privacy — Game result data is stored in your Google Sheet. Ensure your spreadsheet sharing settings are appropriate for your data privacy requirements.
Testing Your Webhook
You can test your webhook endpoint using curl:
Expected response: S
Building a Leaderboard with Webhook Data
The webhook data you receive can be used to build your own leaderboard. Below are no-code and low-code options that receive scores and display rankings on your website.
Option 1: Zapier + KeepTheScore (Recommended)
Use Zapier to receive the webhook and push scores to KeepTheScore, which provides a hosted leaderboard with real-time updates.
Step 1: Create a Zap
Go to Zapier and create a new Zap
Trigger: Choose "Webhooks by Zapier" → "Catch Hook"
Copy the webhook URL provided by Zapier
Paste this URL into your campaign's Webhook URL field in Studio
Set Result data format to
json
Step 2: Create a KeepTheScore Board
Go to keepthescore.com and create a new leaderboard
Note your board ID from the URL (e.g.,
https://keepthescore.com/board/xxxxxx/)Get your API key from the board settings
Step 3: Connect Zapier to KeepTheScore
Action: Choose "Webhooks by Zapier" → "POST"
URL:
https://keepthescore.com/api/xxxxxx/score/Payload Type:
jsonData: Map
userid→ player name,score→ score value
Step 4: Embed on Your Website
Real-time updates
Scores appear automatically
Filters
All-time, daily, weekly, monthly
Pricing
Basic free, premium features paid
WordPress
WP plugin available (shortcode embed)
Option 2: Airtable (Webhook + Data Management + Embed)
Airtable can receive webhooks directly, store data, and embed a sorted view as a leaderboard.
Step 1: Create a Base
Create an Airtable base with these fields:
userid
Single line text
score
Number
tx_id
Single line text
time
Date
playtime
Number
Step 2: Set Up Webhook Automation
Go to Automations → Create automation
Trigger: When webhook received
Copy the webhook URL and paste it into Studio's Webhook URL field
Action: Create record — map the webhook fields to your table columns
Step 3: Create a Leaderboard View
Create a new Grid view named "Leaderboard"
Sort by
scoredescendingHide unnecessary columns (tx_id, playtime, etc.)
Step 4: Embed on Your Website
Click Share and sync → Embed this view
Copy the iframe code
Webhook
Built-in, no middleware needed
Data management
Filter, search, export
Pricing
Free (1,000 records), Team $20/user/month
Limitation
Embed uses Airtable's default styling
Option 3: Google Sheets + Common Ninja Widget
Combine the Google Sheets integration above with Common Ninja's Leaderboard Widget for a visual leaderboard.
Step 1: Set up Google Sheets webhook receiver (see above)
Step 2: Create a Common Ninja leaderboard widget
Create a new widget and configure the API Integration to read from your Google Sheet
Customize the design (colors, layout, number of entries)
Step 3: Embed the widget on your website
Design
Highly customizable
Data source
Google Sheets, Airtable, or API
WordPress
WP plugin available
Pricing
Free tier available
Option 4: Leaderboarded
Leaderboarded.com — dedicated leaderboard SaaS with API and WordPress support.
API
REST API for pushing scores
Themes
40+ leaderboard themes
Embed
iframe, real-time updates
WordPress
Pricing
Free tier, embed requires Business plan
Which Option Should I Choose?
Easiest setup
Good
Best
Moderate
Good
Leaderboard design
Good (themes)
Basic
Best (customizable)
Good (40+ themes)
Data management
Limited
Best
Good (Sheets)
Limited
No middleware needed
No (Zapier)
Yes
No (Apps Script)
No (Zapier/Make)
WordPress plugin
Yes
No
Yes
Yes
Best for
Quick leaderboard
Data + leaderboard
Custom design
Themed boards
Last updated