This website is in test mode. The EasyCoupon free trial opens soon.

Help / For developers

GA4 and dataLayer events

EasyCoupon sends the widget’s key moments to your shop’s own Google tag. No setup needed, and neither the coupon code nor personal data is included.

Where they go

  • If the page has gtag() (the GA4 tag), the event goes as gtag('event', name, params).
  • If not, but there is a dataLayer (Google Tag Manager), as dataLayer.push({ event: name, …params }).
  • If neither is there, nothing is sent.

The events

  • easycoupon_offer_shown – an offer was shown.
  • easycoupon_coupon_revealed – the visitor got the code. Extra params: discount_type (percent, fixed or free_shipping), discount_value.
  • easycoupon_wheel_spun – the visitor spun the wheel. Extra param: won.
  • easycoupon_goal_reached – the cart reached the goal bar’s goal.

Every event carries campaign_id, rule_id, variant_id, pool_id, coupon_label (null where there is no value).

// on a page with gtag and no Google Tag Manager:
gtag('event', 'easycoupon_coupon_revealed', {
  campaign_id: '…', rule_id: '…', variant_id: null, pool_id: '…',
  coupon_label: '…', discount_type: 'percent', discount_value: 10
});

Using them in GA4

  1. The events show in GA4’s realtime view within a few minutes.
  2. To break them down by parameter (for example by campaign), register the parameters as custom dimensions in the GA4 admin.
  3. To count a code reveal as a conversion, mark easycoupon_coupon_revealed as a key event.

Using them in Google Tag Manager

Create a custom event trigger on the event name (for example easycoupon_offer_shown) and read the parameters with dataLayer variables.

Related articles