Moclick Bridge
Integration

Conversion object

How to report the transaction value and identifier on the confirmation page, and what happens in each case.

Declaration#

On the order confirmation page, define window.MoclickConversion:

HTMLconfirmation page
<script>
  window.MoclickConversion = {
    value: 150.00,
    transaction_id: "ORDER-12345"
  };
</script>

Its position in the document does not matter: it can come before or after the global tag. See how the conversion is detected.

Parameters#

ParameterTypeRequiredDescription
valuenumber | numeric string Recommended Monetary value of the conversion. Sent with two decimal places.
transaction_idstring Recommended Unique identifier of the order, lead or event. This is the deduplication key.
Technically optional, operationally required

The tag accepts window.MoclickConversion = {} and tries to record anyway. What omitting them costs you:

  • No value: the conversion is recorded without a value. Revenue and CPA reporting comes out incomplete.
  • No transaction_id: deduplication falls back to the click identifier alone. The visitor then records exactly one conversion per click — a second purchase by the same user is silently discarded as a duplicate.

Value format#

  • Accepts a number (150.5) or a numeric string ("150.50")
  • Use a dot as the decimal separator. A comma is not parsed
  • Do not include a currency symbol or a thousands separator
  • Always sent with two decimal places; stored with two decimal places
JavaScriptexamples
// Correct
{ value: 1499.9,     transaction_id: "A-1001" }   // → 1499.90
{ value: "1499.90",  transaction_id: "A-1001" }
{ value: 0,          transaction_id: "LEAD-77" }  // lead with no revenue

// Incorrect
{ value: "1.499,90", transaction_id: "A-1001" }   // decimal comma → ignored
{ value: "R$ 1499,90", transaction_id: "A-1001" } // currency symbol → ignored

Choosing the transaction_id#

It has to be unique per conversion and stable — the same order must always produce the same identifier, even if the page is reloaded.

SourceSuitable
E-commerce order numberYes — this is the default choice
Payment provider transaction IDYes
CRM lead IDYes, for lead generation campaigns
Timestamp or random numberNo — reloading the page creates a duplicate conversion
Customer ID or email addressNo — the same customer’s second purchase is discarded
Always the same fixed valueNo — only the first conversion is ever recorded

Do not use personal data as the transaction_id. An email address, tax ID or phone number in that field would be stored as the transaction identifier, which needlessly widens the scope of personal data being processed. Use the order number.

Deduplication#

It happens in two independent layers. Reloading the confirmation page, returning to it through browser history or receiving a repeated postback does not create a duplicate conversion.

In the browser#

The tag marks locally that the conversion has already been sent, which prevents a resend on page reload. If local storage is blocked, server-side deduplication takes over.

On the server#

A unique key over the event type, the click identifier and the transaction_id:

  • One click record per click identifier
  • One conversion per click identifier + transaction_id pair
  • A conversion without a transaction_id deduplicates on the click identifier alone

A duplicate request is treated as a success: the response is normal and nothing is written twice. That is what makes retrying safe — see retries and idempotency.

Multiple conversions on the same page#

To record more than one conversion without a reload — a cart with separate orders, a multi-step subscription flow — reassign the object. Every assignment is detected and processed, and a distinct transaction_id keeps it from being treated as a duplicate:

JavaScript
window.MoclickConversion = { value: 150, transaction_id: "A-1" };
// later, in the same page load
window.MoclickConversion = { value: 89.9, transaction_id: "A-2" };
Atualizado em agosto 5, 2026