I’m trying to count form fields that are filled in before a form is abandoned using a custom HTML GTM tag containing the following:
<script>
document.querySelector('.Form').addEventListener('change', function(e) {
dataLayer.push({
'event': 'form interaction',
'form_field': e['target'].getAttribute('name')
});
});
</script>
GTM preview seems to be ok with it and when focus is removed from an input it’s firing the tag.
However, nothing is in GA under events. I’ve looked at a lot of very long blog posts on the topic today and have got in a bit of a twist with variables, custom triggers and other things, but can’t wrap my head around them.
What else needs to happen for those events to show up in GA?