Conversion tracking script — close the loop between the DM and the sale
What it is
Section titled “What it is”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.
How to activate it
Section titled “How to activate it”-
Go to Business setup. On the Integrations card, click the Integrations button.
-
Find the Conversion tracking tile and click Manage.
-
Click Activate. ZeroChats generates a private token (it starts with
zct_) that identifies your account and opens the tag builder. -
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.
-
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:
<scriptsrc="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.
Where to install it
Section titled “Where to install it”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.
How it recognizes the lead
Section titled “How it recognizes the lead”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 the lead’s identifier: their Instagram username or their WhatsApp phone number.
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 looks for the lead in this order:
- The
utm_useridentifier (Instagram username or phone). - The email the visitor typed into the form.
- The phone the visitor typed into the form.
If nothing matches, the event is ignored. Repeated events for a lead already in the target stage are ignored too: no duplicate stage changes.
What the script detects
Section titled “What the script detects”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 sends them to help identify the lead.
- 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 optionalTechnical considerations
Section titled “Technical considerations”- The
zct_token only identifies your ZeroChats account — it grants access to nothing else. Still, treat it as private: events are accepted from any page carrying a valid token. - The email and phone captured in forms are stored on the lead’s contact info.
- The identifier is remembered for 30 days and works within the same domain.
Best practices
Section titled “Best practices”- 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.