# Set up Transaction Tag with Google Tag Manager

{% hint style="info" %}
There is no risk of flickering for the transaction tag with Google Tag Manager since this does not make any visual change: the tag is there only to gather transaction data.

You can put the generic AB Tasty code directly into your page while still using GTM to insert the transaction tag. In this case, make sure you put the generic AB Tasty tag in between your pages' **\</head>** tags.
{% endhint %}

{% hint style="success" %}
[Check our video for a guided Tutorial](https://docs.abtasty.com/account/how-to-implement-the-transaction-tag).
{% endhint %}

#### Prerequisites

* A [Google Tag Manager account](https://tagmanager.google.com/#/home) (free) with your configured variables
* AB Tasty platform access
* Published AB Tasty campaign (optional, for validation)

{% stepper %}
{% step %}
Log in to your GTM account.
{% endstep %}

{% step %}
Go to Tags > **New**
{% endstep %}

{% step %}
Enter your Tag name
{% endstep %}

{% step %}
Click **Tag Configuration**
{% endstep %}

{% step %}
Select **Custom HTML tag type**
{% endstep %}

{% step %}
Add `<script></script>` tags
{% endstep %}

{% step %}
Paste the [AB Tasty transaction tag script](https://app.gitbook.com/s/dG0EHdNiO40UVA7Bz9mR/data-apis/universal-collect/uc-hits#transaction) between the \<script> tags

{% hint style="info" %}
Capitalized items are dynamic variables.
{% endhint %}
{% endstep %}

{% step %}
Replace all placeholder values based on your data layer variables configuration.

{% hint style="info" %}
Only Transaction Affiliation, ID and Revenue are required.
{% endhint %}
{% endstep %}

{% step %}
Make sure you have applied the appropriate format to your values, as described in t[he developer's documentation.](https://app.gitbook.com/s/dG0EHdNiO40UVA7Bz9mR/data-apis/universal-collect/uc-hits#transaction)

{% hint style="info" %}
If the ICN (Item Count Number) parameter is not already available as a data layer variable, you might need to create a short JavaScript Code to calculate it
{% endhint %}
{% endstep %}

{% step %}
If you want to collect data at Item level

1. &#x20;Add the dedicated template from [the developers' documentation](https://app.gitbook.com/s/dG0EHdNiO40UVA7Bz9mR/data-apis/universal-collect/uc-hits#item)&#x20;
2. Match the variables according to the data layer

{% hint style="info" %}
Keep in mind that one item in the order = one request
{% endhint %}
{% endstep %}

{% step %}
Once the script is done, select your triggering:

1. Click on the Triggering area
2. In the opening menu, select the purchase event as a trigger: **event equals purchase**
3. Optionnal: add a **Blocker** if the consent is not granted for AB TAsty cookies.&#x20;
   {% endstep %}

{% step %}
Click Save.&#x20;
{% endstep %}

{% step %}
To QA

1. &#x20;Click **Preview**.
2. &#x20;Go to your website’s order confirmation (thank you) page.
3. Open your browser’s Developer Tools (usually F12).
4. Go to the **Network** tab.
5. Place a test order (or simulate one if possible).
6. Look for a request to `ariane.abtasty.com`—this is the endpoint where transaction data is sent.
7. Check the request payload for transaction details (transaction ID, amount, items, etc.)

{% endstep %}
{% endstepper %}
