Reputation: 331
I'm currently trying to trigger dataLayer push events on submit for wffm mvc form. There are a couple of sources I've found and none of them has worked so far for MVC. The closest to what I could work with is combining what I've gathered with these two links Sitecore WFFM: act on success and Trigger Google Analytics Events on Sitecore Web Forms
Currently, I'm stuck on trying to output the form's success message since wffm mvc does not have Form.SuccessMessage(or as far as I know).
For webforms it's like this:args.Result = args.Form.SuccessMessage + script;
Any help would be much appreciated.
Upvotes: 0
Views: 377
Reputation: 61
datalayer where trigger on html element push using javascript. for example: Your html element on show ,you want to push datalayer.
$('#loading').on('shown.bs.modal', function () {
dataLayer.push({ event: 'modalShowSuccessGoogleTy' });
});
ı hope this example can be helped you.
Upvotes: 0