Tracking Form Submission using a Javascript Triggered Goal

In some cases, a  form that you want to track does not have an "action" attribute, and therefore cannot be tracked with the standard form submission goal template. For those cases, an alternative is to create a Javascript Triggered Goal.

Create a Javascript Triggered Goal

In your Experiment Summary page go to your Goals:

mceclip1.png

Then to Goal Templates and select Javascript Triggered Goal:

Name the goal and save it:

Once it is saved, go to edit the goal and copy its ID:

Add JS code on Global Project Javascript

To apply the tracking code on the project, copy the below code into the Global Project JS section located on the Project Settings, replacing the goal ID with your own:

mceclip0.png

Code:

convert.$( "#formID" ).submit(function( event ) {
conv_q = _conv_q || [];
conv_q.push(["triggerConversion","12345678"]);
console.log('Form Submitted');
}

Attach Goal to Experience

Attach this goal to the experience where you want to track submissions:

You are ready to go!

Need assistance? Start a conversation with our Support Team.
CONVERT MORE

Reliably Convert More Site Visitors, Even If Everything Else is Changing in Your Business.

START 15-DAY FREE TRIAL
✓ No Credit Card  ✓ Easy Set-Up  ✓ Access All Features

Comments