Closed laurelfulford closed 1 month ago
Thanks for the review @chickenn00dle! This should (largely) be ready for review again, but I'm going to confirm some of the GA4 data stuff -- if you'd like to leave it 'til then, I can update here when that bit has been confirmed 🙂
Leaving this one open for now, but I've started reworking this PR here to have a fresh start and add front-end events.
Closing in favour of the reworked draft: https://github.com/Automattic/newspack-plugin/pull/3297
All Submissions:
Changes proposed in this Pull Request:
Along with https://github.com/Automattic/newspack-blocks/pull/1768, adds GA4 tracking events to the modal checkout.
This is my first time working with our GA4 Data Events, so the exact information being tracked when and why could use some special attention. I'm adding @kmwilkerson as a tester just to make sure it gets her eyes, too!
The following should be tracked:
See 1205234045751551-as-1206525965459152
How to test the changes in this Pull Request:
npm run build
.error_log( print_r( $event, true ) );
after this line.np_modal_checkout_interaction
event, for each step. Some are already baked in to the Data Events, so I bolded the ones added for this event, and I added notes where I wasn't 100% sure what was being captured was correct:When the modal checkout is opened from a Donation or Checkout Button block:
form_submission_received
, since the modal is triggered by a successful form submission).donation
for any donation purchases, andpaid_membership
for any other purchase type)When the Continue Button is clicked:
form_submission_received
)2
when you click Continue or in a weird case where, if you finish up page 1, refresh/navigate away from the page, and restart the checkout since it drops you on page 2).Click button to complete purchase:
form_submission_received
since we're not tracking success/failure here)Other information: