JavaScript Event for Stripe Element Interaction on Checkout Page
-
Hi Support Team,
We are using your “Payment Plugins for Stripe WooCommerce” plugin on our website and implementing custom Google Analytics 4 tracking via Google Tag Manager.
We want to trigger a GA4
add_payment_infoevent when a user first starts interacting with the Stripe credit card input fields (Card Number, Expiry, CVC) on the WooCommerce checkout page.We understand these fields load within an iframe for security, which prevents standard JavaScript listeners (
focusin,input) on our main page from detecting interaction due to the Same-Origin Policy.Does your plugin trigger any client-side JavaScript custom events (e.g., on
document.body,window, or a specific container) or provide any JavaScript hooks/callbacks that we can listen for, indicating when:- The Stripe card input elements are initialized and ready?
- A user focuses on one of the Stripe card input fields (Card Number, Expiry, or CVC)?
- The content/value within one of these fields changes?
Having such an event (especially for focus or readiness) would allow us to reliably trigger our GTM tag when user engagement with the payment fields begins. Could you please provide the names of any available events and how to listen for them?
Thank you for your assistance!
Best regards,
The topic ‘JavaScript Event for Stripe Element Interaction on Checkout Page’ is closed to new replies.