Skip to main content
Jotform Form Tracking

Discover how to set up automatic form tracking for Jotform forms, enabling the Cometly Pixel to seamlessly capture form field data.

Updated this week

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 Cometly Webhooks or Zapier

There are two methods for sending event data from Jotform to Cometly (Cometly Webhooks or Zapier). Please see sections of our Jotform Integration article below depending how you would like to send events to Cometly.

➑️ Set Up Jotform Integration
​
​
​
​
​

Did this answer your question?