Skip to main content

Automatic Form Tracking

Dreamdata Analytics provides a script designed to automatically track your form submissions. In cases where automatic tracking does not suffice, manual tracking may be necessary.

Our script supports automatic identification and tracking for several types of form setups, including:

How Automatic Tracking Works:

The script operates by scanning the HTML document to locate forms and listen for their submissions. When a form is successfully identified, the script executes two key functions during the form submission event:

Function Details:

  • dreamdata.track('Downloaded newsletter'): This function is used to record the specific action or event associated with the form submission, referred to by a user-friendly name. It's crucial to choose names that are easily recognizable and meaningful, as these will appear across Dreamdata reports, aiding in quick and clear data assessment.
  • dreamdata.identify(): This function is essential for form tracking as it identifies the user by extracting the email address from the form submission. This capability is critical for linking user actions directly to an identifiable profile, enhancing the accuracy and utility of the tracking data.

Unsupported Forms

Forms that we cannot automatically track include those loaded dynamically, for example pop-ups triggered by a user action. These are often referred to as "widgets." The primary challenge with tracking these forms is that they load dynamically based on user interactions, whereas our tracking scripts are designed to interact with forms that are present when the webpage initially renders. This timing mismatch means that the script misses the opportunity to attach tracking mechanisms to these dynamically loaded elements.

Our tracking system relies on scanning the HTML of a webpage as it loads to identify and attach hooks to forms for data capture. Widgets and dynamically loaded forms that appear post-page load due to a user’s action (like clicking a button or engaging with content) are not present during this initial scan and therefore are not automatically recognized by our system.

Here is a diagram to visually represent the problem of tracking dynamically loaded forms:

To effectively track these dynamic forms, we recommend manually calling Dreamdata Analytics in your form submission handlers. Specifically, you can utilize the .track and .identify methods provided by our library. By manually calling these methods within the handlers that manage form submissions, you can ensure that every interaction with dynamically loaded forms is captured and tracked.

Refer to Manual Form Tracking for more details.