Uploaded image for project: 'Planet4'
  1. Planet4
  2. PLANET-7105

Automatically fire data layer script on GF donation confirmation Pages

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Merged
    • Icon: Should have Should have
    • 2.107.0
    • None
    • 3
    • Analytics
    • Sprint #206, Sprint #207, Sprint #208, Sprint #209, Sprint #210, Sprint #211, Sprint #212
    • saturn

      Summary

      The Gravity Forms Google Analytics plugin doesn't work for forms with the "donation" form type. Once the user completes the donation on Stripe, they are redirected to the P4 Thank You page, and there's no standard GFTrackEvent or FormSubmission event there.

      The GPI Analytics team (aka Julia and Mariusz) has a temporary solution - manually adding a dataLayer script in the HTML of the Confirmation Message:

      1. ript> window.dataLayer = window.dataLayer || []; window.dataLayer.push({ 'event': 'formSubmission', 'gGoal': 'Donation', 'formPlugin': 'Gravity Forms', 'formID': ' {form_id}

        ', // you can replace that 2 with anything you want. Just make sure it makes sense to you. 'formTitle': '{form_title}', 'formValue': '{amount_total:21}' }); </script>

      Tag manager then looks for a formSubmission event where gGoal equals Donation. Then we have an e-commerce script to track the transactions:

      Requirements

       

      1. Send events automatically from the confirmation page: Right now we're adding the script manually, it'd be great if we can automatically fire the dataLayer script on the confirmation page (for Donation form types)
      1. Investigate how to obtain the missing information in e-commerce script: The parameters transaction_id, item_id, currency, and payment method aren't passing from Stripe to P4 - we aren't sure why that is or how to get them. Any ideas? 

       

        1. image (1).png
          189 kB
          Molly Marcott
        2. image (2).png
          116 kB
          Molly Marcott
        3. Screenshot 2023-06-21 at 11.23.34.png
          1.31 MB
          Julia Marubayashi
        4. Screenshot 2023-06-21 at 11.24.07.png
          1.29 MB
          Julia Marubayashi

            fhernand Florent Hernandez
            mmarcott Molly Marcott
            Sagar Deshmukh Sagar Deshmukh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: