Skip to main content
Track payment success and failure events in your analytics platform (Google Analytics, Segment, etc.).

Recipe

How it works

  1. Listen for primer:payment-success and primer:payment-failure DOM events
  2. Extract relevant data from event.detail
  3. Send to your analytics platform with meaningful event names and properties

Variations

Google Analytics 4 / Firebase Analytics

Segment / Reusable analytics wrapper

Track payment method selection

See also

Log errors for debugging

Capture and surface errors during development

Events guide

Handle payment lifecycle events