I’m having trouble with the configuration options for custom form tracking using the Javascript version 3 tracker. I want to track only fields which do not have the class “private”.
Following the custom form tracking documentation I decided to use the filter
option to filter out fields which contain the private
class. Here’s the code I wrote to set the form tracking options:
const config = {
forms: {
denylist: []
},
fields: {
filter: function (elt) {
return !elt.classList.contains("private")
}
}
};
window.snowplow('enableFormTracking', { config });
With the above code I can see using the snowplow debugger chrome extension that the tracker is still capturing events for fields with the “private” class.
Any ideas what I could be doing wrong?