Skip to main content
Jotform Form Tracking

Learn how to track the source of Jotform submissions.

Updated over a month ago

Start Here πŸ‘‹

In this article we will cover the steps on how to configure your Jotform form so you can track submissions to the correct source and automatically send events to Cometly.

The setup in this help article is specifically for embedded Jotform iframes.


Step 1: Add New Hidden Field to your Jotform

Create and add a new short text element to your form.

For the Field Label, enter: comet_token

While you have the comet_token short text field selected, click Advanced and then toggle on Hide field


Step 2: Add Custom Code to your Webpage

On the page where you have the embedded Jotform iframe, you need to add custom code that will automatically append the comet_token from the Cometly pixel to the iframe URL. This code will enable you to retrieve the comet_token and include the comet_token when you are sending the event to Cometly.

Before you add the custom code, first navigate to the Jotform publish page and click Embed and then click IFRAME

When the IFRAME option opens, you will see iframe id =
​

Copy the iframe ID located in between the quotes.

In the example below it's JotFormIFrame-232904902981157

You will need to update the iframe ID in the code below where it says ADD.IFRAME.ID.HERE

Important: Only place the code below on the specific web page where your iframe code is embedded and ensure you replace the iframe ID as indicated above.

<script>
function getCometToken() {
return cometToken();
}

document.addEventListener("DOMContentLoaded", function () {
var iframe = document.getElementById("ADD.IFRAME.ID.HERE");

var cometToken = getCometToken();

if (cometToken) {
var currentSrc = iframe.src;
var newSrc = currentSrc + "&comet_token=" + encodeURIComponent(cometToken);
iframe.src = newSrc;
}
});
</script>


Step 3: Send event data via Webhooks or Zapier

Important: For accurate tracking, ensure you map the comet_token when sending your event

Webhooks

  • Inside your Jotform, click Settings

  • Click Integrations

  • Search for Webhook

  • When you are mapping the event data for the specific Cometly Webhook, ensure you map the comet_token.

Zapier

After you have published your site with the code in the previous step added, submit a new Jotform submission.

The following information is assuming you are using Zapier. If you are using another method for sending the Jotform submission to Cometly, you should still see the Answers Comet Token.

You should see Answers Comet Token in your payload:

Map the value in the Answers Comet Token to the Comet Token field when sending the event to Cometly:

If you are using Zapier or another platform to send events to Cometly, ensure you map other fields to the correct fields: first name, last name, email, phone, etc.

Did this answer your question?