Skip to main content

How to add the Kadam pixel to GTM

Written by Olga

This guide is universal: it contains no real Audience IDs. Audience IDs are always taken from the Kadam advertiser account (the Audiences section → retargeting code).

Copy the pixel code from your account — it already contains the up-to-date script and your own audience_id. In GTM, replace the placeholders (remote_uid, and cost plus the extra parameters if needed) with {{…}} variables and assign triggers. Do not assemble the snippet manually from scratch.

1. Basic set of audiences

Create a separate set of pixels (audiences) in your account for the basic plan:

Audience

When it fires

Visit_auth

An authorised visitor (the user is logged in on the site)

Reg_finished

The user has successfully completed registration

FTD

The user has successfully made their first deposit

RD

The user has successfully made any repeat deposit

Active

The user is logged in and a condition is met: balance / total top-ups / number of top-ups ≠ 0

For each audience, copy the code from your account (your own audience_id is already inside) and create a separate GTM tag for it.

Important about remote_uid: in the pixel calls of every audience in the funnel, pass the same stable user identifier (internal user id, login and so on). It must not change between Visit → Reg → FTD → RD → Active. Without this, post-view / post-click conversion attribution will not work.

Before installing code containing our pixel on the site, you must obtain the user's consent, where this is required in order to comply with the applicable legislation.

2. Current pixel code (recommended)

The standard way is the pixel script from the Kadam account: it loads audiencex/pixel.js and marks events via kdm("mark", …).

Kadam pixel domain: r.uuidksinc.net.

Below are templates showing what the code looks like after the GTM variables have been substituted. In the account, AUDIENCE_ID is already the numeric audience id — you do not need to change it. Replace only placeholders such as {remote_uid} / parameter values with {{ClientID}}, {{DepositCost}} and so on.

Minimal working option (Visit_auth / Reg_finished)

For events without an amount, do not pass cost and do not leave empty numeric GTM variables — otherwise the Custom HTML tag can break syntactically.

<script>
(function(win, doc, tag, src, name) {
    win[name] = win[name] || function() {
        (win[name].q = win[name].q || []).push(arguments);
    };
    var el = doc.createElement(tag);
    el.async = true;
    el.src = src;
    var first = doc.getElementsByTagName(tag)[0];
    first.parentNode.insertBefore(el, first);
})(window, document, "script", "https://r.uuidksinc.net/audiencex/pixel.js", "kdm");
kdm("mark", {
    audience_id: AUDIENCE_ID,
    remote_uid: "{{ClientID}}"
});
</script>

AUDIENCE_ID in the example is the id from the account code (without quotes), unique for each tag; {{ClientID}} is a GTM variable.

Option with an amount (FTD / RD)

<script>
(function(win, doc, tag, src, name) {
    win[name] = win[name] || function() {
        (win[name].q = win[name].q || []).push(arguments);
    };
    var el = doc.createElement(tag);
    el.async = true;
    el.src = src;
    var first = doc.getElementsByTagName(tag)[0];
    first.parentNode.insertBefore(el, first);
})(window, document, "script", "https://r.uuidksinc.net/audiencex/pixel.js", "kdm");
kdm("mark", {
    audience_id: AUDIENCE_ID,
    remote_uid: "{{ClientID}}",
    cost: {{DepositCost}}
});
</script>

{{DepositCost}} must substitute a positive number (for example 50 or 50.00). A value of 0 or an empty substitution does not pass the amount to Kadam (and an empty substitution can break the JS).

Full template with additional parameters

Add to the mark object only those fields that have a value at the moment the tag fires.

<script>
(function(win, doc, tag, src, name) {
    win[name] = win[name] || function() {
        (win[name].q = win[name].q || []).push(arguments);
    };
    var el = doc.createElement(tag);
    el.async = true;
    el.src = src;
    var first = doc.getElementsByTagName(tag)[0];
    first.parentNode.insertBefore(el, first);
})(window, document, "script", "https://r.uuidksinc.net/audiencex/pixel.js", "kdm");
kdm("mark", {
    audience_id: AUDIENCE_ID,
    remote_uid: "{{ClientID}}",
    event: "{{Event}}",
    param_str: "{{ParamStr}}",
    param_str_2: "{{ParamStr2}}",
    param_int: {{ParamInt}},
    param_int_2: {{ParamInt2}},
    cost: {{DepositCost}}
});
</script>

Rules for GTM Custom HTML:

  • An unused parameter — delete the line from the object (do not leave an empty {{ParamInt}} / {{DepositCost}}: you will end up with broken JS like param_int: ,).

  • String fields (event, param_str, param_str_2) are safe inside quotes: even if GTM substitutes an empty string, the snippet will not break.

  • If you copy code from the account with {event} / {param_str} placeholders, the script ignores such values. Numeric placeholders such as {param_int} must not be left as they are in JS — in the account they have already been replaced with null or with a number; in GTM, simply delete the field for numbers you do not use.

  • Without filled-in additional parameters, an audience cannot be used as a source for a filter audience with conditions on those parameters.

3. Pixel parameters

Parameter

Required

Description

audience_id

yes

Audience ID from the Kadam account

remote_uid

yes (for PV/PC attribution and funnel stitching)

A stable user id on the client side

cost

no

The amount of the action (deposit and so on). Must be a positive number; with 0 or an empty value the amount is not passed

event

no

The name of the action, e.g. reg, ftd, deposit, purchase

param_str

no

A string label (source, category, page…)

param_str_2

no

A second string label

param_int

no

A number ≥ 0 (price, quantity…). Fractions are allowed, rounded to 2 decimal places

param_int_2

no

A second numeric value

Parameters can be passed:

  1. Dynamically — through GTM variables / dataLayer at the moment the tag fires;

  2. Statically — hard-coded in the code copied from the account (the “hard-code parameter values” inputs).

4. Prerequisites in GTM

  1. A GTM container has been created for the site domain.

  2. The container code is installed on the site.

  3. The required fields are pushed into the dataLayer on the site (check the exact key names with the client's developers), for example:

window.dataLayer = window.dataLayer || [];
dataLayer.push({
  event: 'deposit',
  clientId: 'USER_123',
  depositCost: 50.00,
  isFirstDeposit: false,
  // optional:
  eventName: 'deposit',
  paramStr: 'main_page',
  paramStr2: 'campaign_42',
  paramInt: 50,
  paramInt2: 2
});

The key names in the example are illustrative — in GTM, the Data Layer Variable name must match the dataLayer key exactly.

Important: event and eventName are different things.

  • The event key in the dataLayer is the event name for the Custom Event trigger in GTM. In the trigger’s “Event name” field, enter exactly its value (deposit in the example).

  • The eventName key (in the example) is a separate field for the pixel’s event parameter; in GTM you create an Event variable for it and pass it into the pixel code as {{Event}}.

  • Do not put eventName or the name of the GTM Event variable into the trigger — the tag will not fire.

isFirstDeposit — the value type must match the condition in the trigger. Check with the client’s developers what actually goes into the dataLayer: a boolean (true/false) or a string ("true"/"false"). Use the same thing in the GTM trigger condition (exactly as it arrives), otherwise FTD and RD may not be separated.

5. GTM variables

Variables → New → the “Data Layer Variable” type.

Recommended minimum:

Name in GTM (example)

Name in the dataLayer (example)

What for

ClientID

clientId

remote_uid

DepositCost

depositCost

cost

IsFirstDeposit

isFirstDeposit

separating FTD / RD (the condition = as it arrives in the dataLayer)

Event

eventName

the pixel’s event parameter (not to be confused with the event key used for the trigger)

ParamStr

paramStr

param_str

ParamStr2

paramStr2

param_str_2

ParamInt

paramInt

param_int

ParamInt2

paramInt2

param_int_2

You can give the variables any names in GTM; what matters is that the Data Layer Variable Name matches the dataLayer key.

6. Tags and triggers by audience

The general procedure for each audience:

  1. Tags → New → Custom HTML

  2. Paste the pixel code from the account (the audience id is already inside); replace the placeholders with GTM variables

  3. Assign a trigger (see below)

  4. Save

  5. Once all tags are set up — Preview, then Submit → Publish (publish the container), otherwise the tags will not work on the advertiser’s site

Visit_auth

  • Trigger: a custom event or a page view with the condition “the user is logged in” (however this is determined on the site — by a dataLayer flag, the presence of clientId and so on).

  • Do not use “All Page Views” if you specifically need a logged-in audience.

  • Always pass remote_uid ({{ClientID}}) into the pixel.

  • Use the minimal code option without cost.

Reg_finished

  • Trigger: the Custom Event of a successful registration (the event name is the value of the event key in the dataLayer; check with the client’s developers).

  • Once per successful registration.

  • The same remote_uid as in Visit_auth.

  • Code without cost if there is no amount.

FTD

  • Trigger: the Custom Event of a deposit (the event name = the event key in the dataLayer) + the condition IsFirstDeposit equals the value that actually arrives in the dataLayer for a first deposit (often true or "true"; or a separate ftd event — depending on how it is implemented on the client side).

  • Pass cost (the positive amount of the first deposit) and, if needed, event / param_str / param_int.

RD

  • Trigger: the Custom Event of a deposit + the condition IsFirstDeposit equals the repeat-deposit value in the dataLayer (often false or "false").

  • Example: in the trigger, the event name is deposit (the event key from the dataLayer), the condition IsFirstDeposit equals false — only if the dataLayer really sends boolean false (if it is a string, write "false").

  • Pass cost and the additional parameters as needed.

Active

  • Trigger: when the user is logged in and the Active business condition is met (balance / total amount / number of top-ups ≠ 0). This is usually a separate event or a page view filtered by the dataLayer.

  • The condition logic lives on the site / dataLayer side; in GTM we only check the ready-made flag or event.

  • Always pass the same remote_uid ({{ClientID}}) as in the other audiences of the funnel.

7. Setup checklist

  1. GTM Preview → go through the scenarios: login, registration, FTD, repeat deposit, Active.

  2. The URL / parameters of the mark request contain a correct remote_uid and, for deposits, a positive cost.

  3. The corresponding pixel calls reach Kadam within the corresponding audiences.

  4. Publish the container: Submit → Publish (otherwise the changes will not apply in production / on the advertiser’s site).

Did this answer your question?