Google Analytics 4.

The GA4 integration sends a purchase event directly to your Google Analytics property. This event contains the total gift card value and details about the purchased products.

Installation

To enable GA4 purchase tracking, add the gtag property to your Gifty script:

          
            
<script>
window.Gifty = {
  key: 'WIDGET_KEY_HERE',
  gtag: true
};
(function (e, t) {
	var n = e.createElement(t);
	n.async = true;
	n.src = 'https://static.gifty.nl/js/widget.js';
	var r = e.getElementsByTagName(t)[0];
	r.parentNode.insertBefore(n, r);
})(document, 'script');
</script>

          
      

Event details

When a customer completes an order, we send a purchase event as below.

          
            
gtag("event", "purchase", {
  transaction_id: "or_E04koXGzj8dl92nb1ywQZgx5",
  value: 185,
  tax: 0.00,
  shipping: 0.00,
  currency: "EUR",
  items: [
    {
      item_id: "gifty-gift-card",
      item_name: "Gifty Gift Card",
      item_variant: "Package: Gifty hoodie (1)",
      price: 35,
      quantity: 1
    },
    {
      item_id: "gifty-gift-card",
      item_name: "Gifty Gift Card",
      item_variant: "Value: 7500",
      price: 75,
      quantity: 2
    }
  ]
})

          
      

The included details are described in the table below.

FieldDescription
transaction_idUnique Gifty order ID
valueTotal value of all gift cards in the order. Note that additional items like wrappings and shipping are excluded on purpose, as this does not count towards your revenue.
currencyCurrency of the order (for example EUR)
itemsAll gift cards in the order
language