Skip to main content

Implementing Custom Tracking Events with GTM

Updated over a month ago

To help you track player behavior and ROI, we have implemented several Google Tag Manager Data Layer events. This guide will show you how to capture these events in Google Tag Manager (GTM) and send them to your preferred analytics or ad platforms.

1. Event Reference Table

Use these exact names when setting up your GTM triggers and variables.

Event Name

Trigger Occurs...

Available Variables

user_data_ready

On all pages for signed-in players.

user_id

sign_up

When a user successfully registers.

user_id

deposit

On every successful deposit.

user_id, amount, currency, transaction_id

first_time_deposit

Only on a player's first-ever deposit.

user_id, amount, currency, transaction_id


2. Step-by-Step Configuration

Step 1: Create Data Layer Variables

GTM cannot "read" data like amount or user_id until you define them as variables.

  1. In GTM, go to Variables > User-Defined Variables > New.

  2. Select Data Layer Variable as the type.

  3. Data Layer Variable Name: Enter the key exactly as it appears in the table above (e.g., amount).

  4. Variable Name: Give it a clear name (e.g., amount).

  5. Data Layer Version: Ensure this is set to Version 2.

  6. Repeat for user_id, currency, and transaction_id.

Setting up a variable:

Your list of variables should look something like this:

Step 2: Create Triggers

Triggers tell GTM when to fire your tags.

  1. Go to Triggers > New.

  2. Choose Custom Event as the trigger type.

  3. Event Name: Enter the exact event name (e.g., deposit).

  4. Name the trigger: Event - Deposit.

  5. Repeat for sign_up, first_time_deposit, and user_data_ready.

Creating a trigger:

Your list of triggers should look like this:

Step 3: Create Your Tags (Example: Google analytics G4A)

Now, connect your triggers and variables to send data to your analytics.

  1. Go to Tags > New and select Google Analytics: GA4 Event.

  2. Event Name: Enter how you want it to appear in GA4 (e.g., purchase).

  3. Event Parameters: Add rows to map your variables:

    • Parameter Name: value | Value: {{amount}}

    • Parameter Name: currency | Value: {{currency}}

    • Parameter Name: transaction_id | Value: {{transaction_id}}

  4. Triggering: Select the trigger you created in Step 2 (e.g., Event - Deposit).


3. Using Custom HTML Tags

If you are using a tracking pixel that requires a code snippet, use the Custom HTML tag type. You can inject your variables directly into the code using double curly brackets:

HTML

<script>
window.pixel.track('Deposit', {
amount: {{amount}},
currency: {{currency}},
user: {{user_id}}
transaction:{{transaction_id}}
});
</script>

Note: Always use Preview Mode in GTM to test your implementation before clicking Publish.

Adding a tracking pixel

Did this answer your question?