Skip to Content
GuidesEvent Handling

Event Handling

Applications should subscribe to SDK events to support analytics, experimentation, and debugging.

Event Types

The SDK emits the following lifecycle and commerce events:

EventDescription
impressionWidget rendered on screen
viewability_reachedWidget entered the viewport
product_clickUser tapped a product
conversation_step_viewedUser advanced the conversation
cta_clickedCall-to-action interaction
redirect_startedNavigation to PDP initiated
checkout_openedEmbedded checkout launched
checkout_completedPurchase transaction succeeded
checkout_abandonedUser exited checkout without completing
error_surfacedRuntime error occurred

Example Event Payload

{ "type": "checkout_completed", "placementId": "cart-sponsored-offer", "productId": "prod_123", "campaignId": "cmp_456", "sessionId": "session_123", "timestamp": "2026-03-24T10:15:30Z" }

Subscribing to Events

Pass an onEvent callback during SDK initialization to receive all events:

<ProductAdsProvider apiKey={process.env.PRODUCT_ADS_API_KEY!} onEvent={(event) => { analytics.track(event.type, event); }} > {children} </ProductAdsProvider>

Forward SDK events to one or more of the following systems:

  • Internal analytics pipeline
  • Product analytics platform
  • Ad reporting pipeline
  • Attribution systems
  • Experimentation framework
Last updated on