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:
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:
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!
Comments