metricanicCallback to the page. Use it in your own scripts to connect buttons, read visit data and send events.
The page needs the installed tracking snippet. See Install the tracking script. On Hosted landings, publish with Add Direct Tracking enabled.
Call a function
Put your code insidemetricanicCallback:
Functions
Connect buttons added later
When the page loads, the script connects links tohttps://<tracking domain>/click and elements with data-dtp-link, including buttons. After a popup, quiz or page builder adds buttons, call:
Build your own offer button
Use this when a button needs its own logic, such as form validation, before opening the offer:registerClick() once per click. Do not use it on links the script already connects. They record clicks automatically.
Pass the click ID to a form
Save the click ID with the lead so your CRM can send events for this visit later:Send an event
- Configure the slot in the campaign’s Events and rules. See Decide what counts as a conversion.
- Without
txuid, every call adds a new event. Use a fixedtxuidfor steps that must count once, such as'form-open'. - Visitors can see and change browser requests. Send revenue from your server or affiliate network instead.
logEvent()completes when the request is sent, not when the event is recorded. Check the result in Events.
Handle a failed start
script_load_failed) or the visit cannot be registered (invalid_response, visit_failed). Callbacks then do not run, and offer links keep their original addresses.