Skip to content

Conversion tracking script — close the loop between the DM and the sale

The Conversion tracking script closes the loop between the link the AI sends a lead in a DM and what that lead does afterwards on your page. When the lead books a meeting or completes a payment, ZeroChats finds out and moves their stage in the Lead funnel automatically:

  • A booking event (booked) moves the lead to Booked.
  • A payment event (paid) moves the lead to Paid.

The stage change is recorded in the lead’s history with an explanatory reason, so you always know why they moved.

  1. Go to Settings and open the What does it connect to? section. The tools are listed under CRM, webhooks and tracking, one card per integration.

  2. Find the Conversion tracking tile and click Manage.

  3. Click Activate. ZeroChats generates a token (it starts with zct_) that identifies your account and opens the tag builder.

  4. Choose the tag options. The builder asks you two things:

    • Which conversion the page reports: Booking → Booked or Payment → Paid.
    • When to report it: On form submit (the default, which detects form submissions and Calendly and GoHighLevel widgets) or On page load (thank-you pages), which reports the conversion as soon as the page opens.
  5. Copy the generated tag and paste it into your page. The tag adjusts itself to your choices — you never edit attributes by hand. For example, for a booking page:

    <script
    src="https://app.zerochats.com/tracking.js"
    data-zc-id="zct_..."
    data-zc-event="booked"
    async
    ></script>

    Use one tag per page and publish the changes.

You can activate and deactivate the integration from the dialog or directly from the tile, with the button next to Manage. If you deactivate it, everything pauses but the token is kept: any tags you already installed start working again as soon as you reactivate, without touching your pages.

The script goes on any page you control:

  • GoHighLevel funnel pages: in the funnel or page, go to Settings → Tracking code and paste the tag before </body>.
  • GoHighLevel calendars: the tag also works in the calendar’s own custom-code settings — it runs inside the booking widget itself and captures the booking form’s email and phone automatically. Follow the official GoHighLevel guide to embed the calendar and add the custom code element.
  • Landing pages that embed Calendly: the script goes on your page, the one that contains the widget. It cannot be installed inside calendly.com. If you haven’t embedded the widget yet, follow the official Calendly guide.
  • Payment, checkout and thank-you pages.

Generate the Booking → Booked tag for booking pages and the Payment → Paid one for payment pages — one tag per page.

While the integration is active, every link ZeroChats sends to a lead — sales links, links in text, Instagram link buttons and link contents — automatically carries a utm_user parameter with an encrypted identifier for the lead. It is an opaque 22-character value, for example utm_user=qdfomARk3BiETYsZgmtDbg: it reveals nothing about the lead, it is always the same for the same lead, and it keeps URLs short.

When the lead opens your page, the script reads that parameter and remembers it for 30 days in the browser. That way tracking survives multi-step funnels on the same domain: the lead can land on one page, navigate to another and convert there.

When an event arrives, ZeroChats recognizes the lead only by that encrypted identifier. An event that arrives without it moves no lead and stores nothing. Repeated events for a lead already in the target stage are ignored too: no duplicate stage changes.

The email and phone the visitor types into the form do not identify them: once the lead is identified by the link, they are saved on the lead’s contact details to complete their profile.

Once installed, the script detects conversions on its own:

  • Form submissions (native HTML forms). It also extracts any email and phone the visitor typed and saves them on the lead’s contact details.
  • Clicks on submit-style buttons near filled email or phone fields — for widget builders that don’t use native forms.
  • Embedded Calendly widgets: the notice the widget emits when a meeting is confirmed.
  • GoHighLevel booking and form widgets: booking confirmations and form submissions from GHL widgets.
  • Thank-you or confirmation pages: generate the tag with the On page load (thank-you pages) option and the conversion is reported as soon as the page opens.

For anything else, there’s a manual JavaScript API:

window.ZeroChats.track('booked', { email: '...', phone: '...' });
// or 'paid' for payments; email and phone are optional

If you want a custom integration instead of the script — or alongside it — you can resolve the utm_user yourself from your server with GET /api/v1/leads/resolve of the ZeroChats API: it returns the lead, and with PATCH /leads/{id} you change their stage, tags or contact details. Always do it from your backend: the API key must never be in the page’s code or in anything the visitor’s browser can read.

  • The zct_ token only identifies your ZeroChats account — it grants access to nothing else. It is visible in your page’s source, and that is expected: what ties each event to a specific lead is the encrypted identifier in the link, not the token.
  • The email and phone captured in forms are stored on the lead’s contact details once the lead is identified by the link. They are never used to identify the lead: an event without the encrypted identifier moves nobody.
  • The identifier is remembered for 30 days and works within the same domain.
  • Each account can apply at most 30 stage changes per hour through the script. Details in Security.

The value of the utm_user parameter is the lead’s internal identifier, encrypted with a secret key unique to your business. ZeroChats generates that key automatically when you activate the integration and it never leaves its servers: you don’t have to store or configure it, and the tag you install on your pages is exactly the same.

Why it is secure even though the tag is visible

Section titled “Why it is secure even though the tag is visible”

Just like Meta Pixel or Google Analytics, the token in the tag is public: anyone can read it in your page’s source, and it only says which business an event belongs to. The only thing that ties an event to a specific lead is the encrypted identifier in the link that lead received privately in a DM. Anyone with the token can send events, but without the encrypted value from a specific lead’s link there is nothing an event can do: the email or phone typed into the form cannot move a lead on their own.

Before, the parameter carried the lead’s Instagram username, which is public — anyone can see who comments on a post. In theory, someone who read the tag could report fake bookings for any lead. Now a forged or altered value decrypts to an identifier that matches no lead, and the event is simply ignored. Only a link ZeroChats actually sent to that lead can move them, and it can only move that one lead.

As an additional safety net — the main defense is the encrypted identifier — each account’s script can apply at most 30 stage changes per hour. Events beyond that limit are discarded silently: the script never sees an error, and a discarded event stores nothing, not even the email or phone captured in the form.

Events that change nothing do not count against the limit: a reloaded thank-you page or a form resubmitted for a lead already in that stage uses no quota. A real funnel books a handful of conversions an hour, so a legitimate business will not hit the limit.

Only links carrying the encrypted identifier move leads. Links sent before this change carry the previous value, the Instagram username, and no longer register conversions. Nothing to do on your side: every message ZeroChats sends since the change already carries the encrypted identifier, with no need to regenerate the tag or touch your pages.

  • Choose On page load for thank-you pages. It’s the most reliable signal: if your funnel has its own confirmation page, install the tag generated with that option there.
  • One tag per page. Don’t mix booking and payment on the same page: each page reports a single conversion type.
  • Check the last-event date on the tile after installing. Run a test yourself by opening a link sent by the AI and completing the form.
  • Install the script on every page of the funnel if the lead goes through several before converting — that way the identifier is remembered even when the conversion happens steps later.
  • Keep the 30 stage changes per hour limit in mind. A normal funnel comes nowhere near that figure; if yours does, let support know before events start being discarded.