Remove inputs from dataLayer when sending data to Google Tag Manager
-
Hello everyone, I hope someone can help me with this issue. I have a form that sends data to Google Tag Manager on submit. The only info I want to get to Google is the form ID but there are many other info, including personal data of the user. For example, I don’t want to send user name and user email to Google Tag Manager. I know I can filter these data before sending it to Google Analytics but I think that there should be a way to prevent the form sending data that I don’p’t want to be sent to third parties. Is there any method to avoid including “inputs” into the Javascript dataLayer object?
My code looks liket this:
document.addEventListener( ‘wpcf7mailsent’, function( event ) {
window.dataLayer.push({
“event” : “cf7emailsent”,
“cf7FormId” : event.detail.contactFormId,
})
});
- You must be logged in to reply to this topic.