Skip to content

Banner Events & Analytics

Analytics events tracked by the GoPayLocal banner script.

The banner script automatically tracks key user interactions and sends them to the GoPayLocal analytics pipeline.

EventTriggered WhenData Sent
impressionBanner is rendered and visibleCountry, discount, campaign ID
clickUser clicks the CTA buttonCountry, discount, campaign ID
copyCoupon code is successfully copied to clipboardCountry, discount, code, campaign ID
dismissUser clicks the close buttonCountry, campaign ID

Events are sent using navigator.sendBeacon(). This has several advantages over fetch() or XMLHttpRequest:

  • Non-blocking — Does not delay page navigation or unload
  • Reliable — Guaranteed to complete even if the user navigates away
  • Lightweight — Minimal overhead, no response handling needed
  • Fire-and-forget — No callbacks, no error handling needed
// Internally, the banner script does something like:
navigator.sendBeacon(
'https://api.gopaylocal.com/v1/events',
JSON.stringify({
type: 'impression',
campaignId: 'camp_xxx',
country: 'IN',
discount: 30,
timestamp: Date.now(),
})
);

To avoid duplicate events and reduce API calls, the banner script uses sessionStorage with a 5-minute TTL:

  • The PPP response (country, discount, code, etc.) is cached per API key
  • Subsequent page loads within the same session reuse the cached data
  • A new API call is made only when the cache expires or the session ends
  • Impression events are de-duplicated per session
// Cache key format
sessionStorage.getItem('gpl_banner_gpl_pk_live_abc123');
// Returns: { data: {...}, timestamp: 1234567890 }

View all event data in the Analytics dashboard:

  • Impressions — How many visitors saw the PPP banner
  • Clicks — How many clicked the CTA
  • Copies — How many successfully copied the code
  • Dismissals — How many closed the banner without copying

Data can be filtered by:

  • Date range
  • Country
  • Campaign
  • Product

GoPayLocal tracks conversions (coupon redemptions) through your connected payment integration. When a coupon code created by GoPayLocal is redeemed, the event is matched back to the original impression.

This lets you see the full funnel:

Impressions → Clicks → Copies → Redemptions
  • No cookies are set by the banner script
  • sessionStorage is used for caching (cleared when the tab closes)
  • No personal data is collected — only country code and interaction events
  • IP addresses are used for geolocation but not stored
  • All data is processed on Cloudflare’s edge network

The banner script is fully compatible with GDPR, CCPA, and other privacy regulations. No consent banner is required for the GoPayLocal script because it does not track users across sites or store personal data.