Skip to main content

I would like to track when a Form is Submitted from profiles so that I can update the Properties. For example, If a user clicks on an action of a popup form, I want to be able to track and see if they have clicked that action and then update their profile with the with a specific Tag. 

I have seen the URL Articles here: https://help.klaviyo.com/hc/en-us/articles/360003953111-Adding-Custom-JavaScript-Events-to-Forms. Please let me know if this Code will work:

 

<script>
window.addEventListener("klaviyoForms", function(e) {
if (e.detail.type == 'open' || e.detail.type == 'embedOpen') {
_learnq.push(s'track', 'Viewed Form - Tracked Profile', {
'formId' : e.detail.formId
}]);
}
if (e.detail.type == 'submit' || e.detail.type == 'redirectedToUrl') {
_learnq.push(s'track', 'Submitted Form - Tracked Profile', {
'formId' : e.detail.formId
}]);
});
</script>

Hi there @jmacman,

Thanks for posting your question to the Community and I hope I can offer some info regarding your question!

As outlined in that document you linked, that would be the proper syntax to track form views and submissions for the profiles. If you wanted to tag people with a property, you can do this if you add a hidden field to each of your forms, as shown in this article.
These will essentially tag all the profiles that fill out a form with the property you set for the hidden field, and you can set up conditional splits or flow filters based on these properties that send people down paths based on these properties, or filter them out entirely. 
This way, even if all the forms submit to the same list, they will each apply a hidden property that can be used to identify people. 

Hope this helped!
Alex


@alex.hong thanks...can you please give me the correct link to the properties article.


Apologies for that @jmacman! The link should be fixed and working now. Unsure what went wrong there but thanks for the callout!


Reply