This route covers how to ensure your Two-step form is tracking each submits in real-time using Google Analytics.
With our two-step form process, we have allowed a form (Incentivized Form) engagement to repeat. This is what helps the second set of form data. However, this change will not segment the events yet. The code below is here to help pass the event via Google Analytics in real-time.
The code below is to be placed in the Tab JS of your promotion.
juapp('trackFunc','engagement',function(email, eventname, promotitle, cmid, options, form){
if (cmid == ENTER YOUR PROMO ID) {
window.juEngNum = window.juEngNum || 0;
if (email!='') window.juEngNum+=1;{ju_ga_event('email-engaged', 'yes')
}
if (email!='' && window.juEngNum==2){
ju_ga_event('fully-engaged', 'yes')
ju_ga_event('SMS-engaged', 'yes')}
}
})
Please ensure you update the code above with the promotion ID in question. Specifically where we indicate - (cmid == ENTER YOUR PROMO ID)
Example: (cmid == 45476)
This will ensure the code only runs for the promotion you are desiring and not any other promotion engagement.
The example below is how the event looks like when reviewing it via Tag Assistant. More info here.
tags: two-step, two step, form, multiple fields, tracking, engagements