Javascript event listener on CF7 integration

[ad_1]

Hi,

I’m using this code in a Google Tag Manager custom trigger:

<script>
document.addEventListener( 'wpcf7mailsent', function( event ) {
 window.dataLayer.push({
 "event" : "cf7submission",
 "formId" : event.detail.contactFormId,
 "response" : event.detail.inputs
 })
}); 
</script>

But I can’t see the mailchimp acceptance checkbox response (some info redacted):

{
  event: "cf7submission",
  gtm: {
    uniqueEventId: 102,
    priorityId: 6,
    start: 1695247683423,
    triggers: "134832263_103",
    element: "HTMLInputElement: html > body.page-template-default.page" +
             ....
             ....
                    "kb-button-width-full",
    elementId: "",
    elementTarget: "",
    elementUrl: ""
  },
  developer_id: {xxxxxxx: true},
  url_passthrough: false,
  ads_data_redaction: true,
  eventCallback: "Function",
  formId: 3044,
  response: [
    {name: "nome", value: "John"},
    {name: "cognome", value: "Doe"},
    {name: "your-email", value: "[email protected]"},
    {name: "Messaggio", value: "Message"},
    {name: "privacy", value: "1"}
  ]
}

Which event listener can i use to trigger newsletter subscription?

Thank you

The page I need help with: [log in to see the link]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer