¶ Introduction
Mentor needs data to work. The more data you send, the better it can analyze player behavior and calculate accurate risk scores.
First, decide how you want to send data:
- Batch Mode – Data is delivered as CSV files (semicolon-separated). Use this mode for historical data or if your system cannot stream. Batch Mode does not offer real-time capabilities.
- Stream Mode – Data is delivered as Pub/Sub messages. This mode enables real-time processing and is strongly recommended whenever technically possible.
¶ Batch Mode
In Batch Mode, you upload files, typically on a schedule, to a dedicated Google Cloud Storage bucket provided by Neccton. During onboarding you receive a service account with permission to upload files. Mentor processes uploaded files automatically via a file listener.
Code samples for uploading objects to a Cloud Storage bucket are available in the Google Cloud documentation.
Mentor expects at least one file per day for each message type. If data freshness matters, you can deliver files hourly.
File names must follow this convention:
mentor_customer_YYYYMMDD_HHMM.csvmentor_cash_YYYYMMDD_HHMM.csvmentor_play_YYYYMMDD_HHMM.csv
The maximum size of a CSV file is 5 TB.
¶ Message Structure
Batch Mode accepts CSV files only. Use a semicolon as the separator and enclose strings in quotes to prevent load errors. The example below uses a CustomerLifetimeEvent.
¶ Stream Mode
Mentor receives streamed data via Google Pub/Sub, which enables real-time processing and analysis. Pub/Sub is a simple messaging service with features similar to MQTT, which may be familiar to some users. Documentation and code examples in several programming languages are available here.
During onboarding you receive a Project ID and a Topic name for streaming. You also receive a service account with permission to publish events, so you can send data securely and directly to Mentor.
¶ Message Structure
Stream Mode accepts JSON payloads. The sample below illustrates the overall structure before the package documentation covers each message in detail. It passes validation against the Protobuf schema on the Pub/Sub topic:
Attributes:
tenantId: f7fd4667-a758-41ba-95a5-b0064465000e
deduplicationId: 1c7e25ea-878a-4af6-99a1-6b0382898f05
Payload:
{
"customerId": "84ed62ee1d6aa83490a75e49836af5fc36f8956496e44627bec0acabf0434cf1",
"eventTimestamp": "2025-01-30T14:11:16.359Z",
"eventTimezone": "Europe/Berlin",
"sourceId": "33b7063a-4132-4622-b6ea-7d3cd39761da",
"eventId": "54c672d6a7e772385d4ae66e225abba1",
"play": {
"gameName": "123456",
"amount": 123.12,
"eventType": "BET",
"processType": "VALID",
"currency": "EUR"
}
}
The schema simplifies your implementation because it catches most common mistakes automatically. If something goes wrong, you receive a clear error message and do not need to contact us.
¶ Attributes
Google provides code examples for adding custom attributes to Pub/Sub messages.
Every event requires these attributes. They are omitted from the message documentation because they never change.
tenantId– The UUID of your company, provided by Neccton.deduplicationId– A globally unique identifier per event that ensures exactly-once delivery and improves performance. We recommend a UUID, but any string that is unique per event is valid.
¶ Payload
Each payload consists of a header and a body.
Header
The header contains fields such as customerId and eventTimestamp. These are required in every event because calculations, mappings, and other processing depend on them. See the full header description.
Body
The body contains the event-specific data. In the sample above, it is a PlayEvent. All event bodies are described in the package documentation.
¶ Event Classification
Mentor sorts incoming data into three event types. Each provides a different view of player behavior.
¶ Customer Basic Data
Customer events form the foundation of a player's profile. They describe when the player registered, their age, and any responsible gaming measures already in place, such as limit changes or play breaks. They also record earlier interactions and status updates. Together they give Mentor an overview of the player's journey.
¶ Play Events
Play events capture every gaming transaction: each slot spin, each sports bet, and each win. They are central to understanding player behavior. When sent via stream, they allow Mentor to react in real time and intervene when it matters most.
¶ Cash Events
Cash events describe a player's financial activity: deposits, withdrawals, and the state of each transaction (requested, valid, or cancelled). This information is vital for assessing a player's financial situation, spotting behavioral patterns, and supporting AML monitoring.
¶ Initial Data Load
Mentor requires an initial data load so it starts with a complete picture of your player base.
Send the basic data of all current customers, plus all open limit changes and active play breaks. If available, also send a three-month history of customer, play, and cash events. This history lets Mentor build a full profile per player and produce accurate scores from day one.
Without historical data, Mentor is still fully functional, but insights will be less detailed until enough new data has accumulated.
¶ Player vs. Customer
The frontend uses the term Player for the end user who places bets or plays games. It is more familiar in the industry and lowers the entry barrier for new operators.
Backend services and data models still use Customer, because renaming it throughout the backend would take significant effort.
In this documentation, Customer and Player mean the same entity.
¶ Player ID Handling
Each event identifies its player through the customerId field. You decide which kind of ID you send:
- Plain ID – The player ID as used in your system.
- Hashed ID – A hash of the player ID, so no readable identifier leaves your system.
Mentor does not use the received ID internally. For every incoming ID it creates an internal UUID, which serves as the reference in all tables, the UI, and URLs.
Recommendations
- Keep the ID stable. Always send the same ID for the same player, across all event types and in both Batch and Stream Mode. Otherwise Mentor treats the events as belonging to different players and cannot build a consistent profile.
- Avoid personal data. Do not use IDs that reveal personal information, such as email addresses or names. Use an opaque ID or a hash.
- Hash consistently. If you hash, use the same algorithm and the same salt (if any) for all events, including the initial data load.
- Do not change the scheme later. Changing the ID format or hashing method after go-live creates new players in Mentor, and their history is not linked to the existing profiles. Contact us first if a change is unavoidable.
- Keep a mapping on your side. Mentor's internal UUID is not visible to you in your own systems, so keep your own mapping between your player ID and the ID you send. This lets you find a player in Mentor from your system, and the reverse.