• Resolved Seanjr88

    (@seanjr88)


    Hi – I am trying to create a google analytics 4 conversion when a user completes any of the contact forms on my pagelayer based theme. I have done this before for another website that uses the plugin ‘contact form 7’. Part of the set up included adding an event listener in Google Tag Manager, code as follows:

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

    What would the code be for pagelayer forms? If I can get the code, I should be okay to manage the rest of the set up.

    Thank you

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support pagelayersupport

    (@pagelayersupport)

    Hello,

    Sorry for the delay in response.

    To get the data of form for analytics you can add on click listener on submit button.

    For more assistance kindly ask it here.

    Plugin Support pagelayersupport

    (@pagelayersupport)

    Hello,

    @seanjr88 is everything working fine?
    or we will assume this thread is resolved.

    Regards,
    Pagelayer Team

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Pagelayer form analytics – listener code?’ is closed to new replies.