Until 17 October 2026, a page with an embedded Kaptly form had no way to know when the form was sent, because the form runs inside its own frame. Analytics on a contact page counted the visits and missed the inquiries. Now the form tells the page every time Kaptly has saved a response. Forms you embedded earlier do it too; there is nothing to paste again.
With the embed script
If you pasted the "Embed on your website" snippet from the Share tab, the one that loads embed.js, your page receives a kaptly:submitted event. One listener on the page counts every form on it:
document.addEventListener("kaptly:submitted", () => {
gtag("event", "generate_lead");
});If a page has more than one form, event.detail.formId says which one was sent.
With a plain iframe
If you pasted the "Plain iframe" snippet instead, the form sends your page a window message of the same type. Any page can send messages to yours, so count it only when it comes from the address your iframe's src starts with:
window.addEventListener("message", (event) => {
if (event.origin !== "https://www.getkaptly.com") return; // the start of your iframe's src
if (event.data?.type !== "kaptly:submitted") return;
gtag("event", "generate_lead");
});Both examples use gtag, the Google Analytics tag. Another analytics tool goes in the same place. In Google Analytics, mark generate_lead as a key event once the first one shows up.
What counts, and what travels
The message carries the form id and nothing from the response. A send that Kaptly refuses, for example because a required answer is missing, is not counted. Preview, the test view in the builder, never sends it; a test you send through the published form counts like any other inquiry. If your site asks visitors for cookie consent, send the event only for visitors who allowed analytics.
In the Guide this is under "Counting submissions in your analytics".
