Skip to content
  1. Home
  2. Help center
  3. Connections
  4. Connect a website — tracking script and webhook

Connect a website — tracking script and webhook

Last updated:

Every website connects to KO the same way, whatever it was built with: a tracking script on the pages, and a webhook that receives form submissions. When both are in place, a lead arrives with the campaign that brought the visitor attached to it. This article covers the connection once — the platform guides only differ in where you paste each piece.

What the two pieces do

They answer different halves of one question, and neither works alone.

  • The tracking script identifies the visitor and records where they came from — the referrer, the UTM tags, the device. It stores an identifier in the _ko_touch_id cookie. This is the source half.
  • The webhook receives the form submission: name, phone, email, whatever the form collected. This is the lead half.

The _ko_touch_id cookie is what joins them. The form sends it along with the contact details, so KO can say that this lead came from that campaign.

Install only the webhook and you get leads with no source — they arrive, they are real, and no report can tell you what paid for them. Install only the script and you get traffic with no outcome.

Set up the connection in KO

  1. In Connects, click Add connect….
  2. In the Websites, quizzes, lead forms, chats category, choose Website: tracking & events and click Connect.
  3. In Connection, set Website platform and connection method to your platform. The list holds ready presets — Tilda, Typeform, WordPress, Framer, Creatium — and three options for a custom-built site, which differ only in how form submissions reach KO:
    • has PHP, server-side webhook — your site posts the lead itself;
    • silent form interception — the script reads submissions without touching how the form behaves;
    • HTML only, with a submission message — the script both sends the lead and shows the visitor a confirmation message.
  4. Describe the connection. A link to the site you are connecting is the most useful description once you have several.

The platform you choose sets the form-capture mode for you, so Website platform is the one field to get right — the rest of the section is the HTML code and the Webhook you are about to install.

Install the tracking script

Copy the HTML code from the connection and put it on the site. Inside <head> is best; through your tag manager works; anywhere in the page HTML works if neither is available.

It has to be on every page you want to measure, including the landing pages that live outside the main template.

Publish the site afterwards. Most builders keep the previous version live until you do.

Add the webhook

Copy the Webhook URL from the connection and add it in the form platform as the destination for form submissions.

Skip this step in one case: if the site already sends leads straight into a CRM and that CRM is connected to KO, the leads come in through the CRM connection and a second copy through the webhook would only duplicate them.

Where the form platform offers it, turn on sending cookies with the webhook — that is how _ko_touch_id reaches KO. If the form is hosted on another domain, the identifier travels as a URL parameter instead; see the platform guide, for example Typeform.

Turn the connection on

When you have set all the options, switch the connection status to Active:

  • Active — everything works.
  • Setting up — everything works, but data updates are paused.
  • Archived — the connection is off; data and statistics are kept.
  • Delete — removes the connection’s data and statistics.

Check that data is coming in

Open your site, then submit the form yourself.

In the connection settings, Last visits and Last leads show what actually reached KO — press Reload data to fill them. Your visit should be in the first table and your submission in the second, with a source rather than just a name.

If it doesn’t add up

The script is not on the page with the form. Builders often let you add code per page. If the form lives on a landing page that skipped the install, its leads arrive sourceless while the rest of the site tracks fine — which looks like a KO problem and is not one.

The site was not republished. The code sits in the builder’s settings, the live pages still serve the old HTML. It is the most common reason a fresh connection records nothing.

The form platform does not send cookies. Some builders have a “send cookies” option on the webhook, off by default. Without it, _ko_touch_id never reaches KO and every lead from that form is unattributed.

The form is not inside a <form> element. The script looks for forms with the CSS selector in Finding forms on the site; a form built out of plain <div>s needs its own selector — any element that contains the fields and the submit button.

Submissions are not captured at all. Switch How form submission is tracked to Button — some form builders never fire the standard submit event, and capturing the button click is what works there.

Visits are recorded from a domain you did not expect. By default the script works on every domain it is installed on. Limit the tracking script to the listed domains in Permissions narrows that; a ! at the start of a line excludes a domain.

Testing with an ad blocker on. Blockers stop the script, and you conclude the setup failed. Test in a clean browser profile.