How it works
A visitor's path, from the ad click to the recorded conversion.
Flow overview#
-
The ad click
The visitor lands on the advertiser’s site through a tracking link, which carries the click identification parameters in the URL.
-
The global tag loads
The tag identifies the campaign from the script URL itself and fetches the matching configuration, with a 5-second timeout.
-
Identifiers are persisted in cookies
The URL parameters go into first-party cookies, with the lifetime set on the campaign. That is what lets the click survive until the conversion, even days later and in a different session.
-
The visit is recorded
When the campaign uses Moclick’s own measurement, the visit is recorded once per page, with a guard against double firing.
-
The tag watches for the conversion
Three mechanisms wait in parallel for
window.MoclickConversion: an immediate check, assignment detection and a periodic check. Detailed below. -
The conversion is recorded and forwarded
The conversion is stored on the Moclick platform and, depending on the campaign configuration, forwarded to the media platforms contracted for that placement. Each forward has its own deduplication: one failing does not block the others.
Campaigns running on external platforms may require the conversion to be reported back to them as well, for optimization and for payment reconciliation. This is configured per campaign in the Moclick dashboard and requires no change to the advertiser’s site — the same tag and the same conversion object cover every case.
The list of platforms involved in each campaign, and the corresponding data processing agreements, are provided to the contracting party. See Privacy and LGPD (Brazilian General Data Protection Law).
How the conversion is detected#
The window.MoclickConversion object can be defined before or after the tag
loads — the tag covers both cases with three simultaneous mechanisms:
| Mechanism | When it fires |
|---|---|
| Immediate check | At load time, if the object already exists on the page |
| Assignment detection | Any later assignment to window.MoclickConversion is caught on the spot |
| Periodic check | Every 500 ms, for up to 120 seconds |
After two minutes the tag stops watching. In a single-page application where checkout can take longer than that between tag load and confirmation, set the conversion object before the user enters the slow flow, or reload the tag on the confirmation route. See single-page applications.
If the page already defines its own getter/setter on
window.MoclickConversion, the tag does not overwrite
it — the existing implementation wins.
Silent failure by design#
Every operation the tag performs is wrapped in error handling. The situations below result in no action at all — never in a visible exception, a console error or a broken render:
- Configuration server unavailable or slow (5 s timeout)
- Campaign missing or unpublished
localStorageorsessionStorageblocked by the browser- Cookies rejected by the domain
window.MoclickConversionmalformed or incomplete
The same policy applies server-side: a request with no click identifier, for a non-existent campaign, or from a source identified as a bot gets a normal response and writes nothing. Details in Architecture and security.