# Google Ads.

> Source: https://docs.gifty.nl/en/order-widget/installation/google-ads
> Language: en

With the Google Ads plugin, you can track completed gift card purchases from the Gifty order module as **conversion events** in your Google Ads account. This helps you measure ROI and optimise your campaigns.

<a id="how-it-works"></a>

### How it works

- Once a payment is completed, the plugin automatically fires a conversion event through Google's gtag API.
- The event contains key purchase details: order ID, order value, and currency.
- To avoid duplicate reporting, the plugin remembers which orders were already sent and will skip duplicates.

---

<a id="installation"></a>

## Installation

1. In your Google Ads account, create a **Conversion Action** and copy the **Conversion ID** and **Label** (e.g. AW-XXXXXXXXX/XXXXXXXXXXXX).
2. Add the Gifty order script to your website and include the gads property with your conversion details as shown below.

```html
<script>
window.Gifty = {
  key: 'WIDGET_KEY_HERE',
  gads: 'AW-XXXXXXXXX/XXXXXXXXXXXX'
};
(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>
```

---

<a id="event-data"></a>

## Event Data

On order confirmation, the following event is automatically sent.

```javascript
gtag('event', 'conversion', {
  send_to: 'AW-XXXXXXXXX/XXXXXXXXXXXX',
  value: 100.00,
  currency: 'EUR',
  transaction_id: 'or_A045Ssa3r5jd4lc8f'
});
```

In this event, the following data is present.

| Field | Description |
| --- | --- |
| send_to | Your Google Ads conversion ID and label |
| value | Total value of all gift cards in the order |
| currency | Currency of the order (for example EUR) |
| transaction_id | Unique Gifty order ID |
