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.
Event Types
Section titled “Event Types”| Event | Triggered When | Data Sent |
|---|---|---|
impression | Banner is rendered and visible | Country, discount, campaign ID |
click | User clicks the CTA button | Country, discount, campaign ID |
copy | Coupon code is successfully copied to clipboard | Country, discount, code, campaign ID |
dismiss | User clicks the close button | Country, campaign ID |
How Events Are Sent
Section titled “How Events Are Sent”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(), }));Session Caching
Section titled “Session Caching”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 formatsessionStorage.getItem('gpl_banner_gpl_pk_live_abc123');// Returns: { data: {...}, timestamp: 1234567890 }Analytics Dashboard
Section titled “Analytics Dashboard”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
Conversion Tracking
Section titled “Conversion Tracking”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 → RedemptionsPrivacy
Section titled “Privacy”- No cookies are set by the banner script
sessionStorageis 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.