-
Task
-
Resolution: Merged
-
Should have
-
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:
- 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
- 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)
- 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?
- relates to
-
PLANET-7479 Improve purchase dataLayer script on GF donation forms
-
- CLOSED
-