# All About Tags

This article will help you to set up your AB Tasty account and be able to launch your first campaigns.

## What is a Tag? <a href="#h_01gg77axh23hj0ke2dhrdgev50" id="h_01gg77axh23hj0ke2dhrdgev50"></a>

A tag is a very short **snippet of JavaScript code** that tells the browser to download an external resource. In our case, this snippet will tell the browser to get the AB Tasty engine with all your campaigns from the AB Tasty servers.

The position (head/body) and attributes (async/defer) used when implementing the tag will determine how it will be downloaded and executed on the website.

A tag can be directly implemented in the source code of a website or through third-party software, such as a Tag Management System, whose role is to simplify the management of tags.

AB Tasty provides two types of tag:

* [The Generic Tag:](#h_01gg77b6sbbqzr44pvw9zbp2kq) that you need to install to use AB Tasty on your website
* [The transaction Tag:](#id-01h7sfp5zmygebbmy14ceh68hs) that you can install to collect further insights on the transaction made on your website

## Finding your Generic Tag <a href="#h_01gg77b6sbbqzr44pvw9zbp2kq" id="h_01gg77b6sbbqzr44pvw9zbp2kq"></a>

**To use AB Tasty on your website, you need to install our tag on your website.**

To find the AB Tasty generic tag, click ![](https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2Fgit-blob-b472ad313f12d5e1a680f36520d6785bf21270fa%2F5b87b6145dd7b36404c531b85949d14e.png?alt=media) **> Implementation > Tag implementation > Generic tag**.

![](https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2Fgit-blob-dd94d004e03ad69bb2111bc67414ec8a222a647f%2F48c4c08f583bca545be389ac016b2c2a.png?alt=media)

### **Differences Between Async and Synchronous Implementation** <a href="#h_01gk2bqa0387aw81tf3m3s9y8w" id="h_01gk2bqa0387aw81tf3m3s9y8w"></a>

The generic tag comes in two versions: **synchronous** and **asynchronous**.

You will find the synchronous version, as well as the asynchronous version in the Generic Tag page.

In synchronous mode, your website’s code scripts will load one after the other. A script can only be loaded if the previous one has finished loading. If a script is blocked, it will stop the script after it from loading.

![All\_About\_Tags\_03.png](https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2Fgit-blob-b8865a71a0b6b55346fc3898358845ff0bf1f46a%2F719c1acf099c2d6505e9e6ab6ad90f89.png?alt=media)

On the other hand, in asynchronous mode, the different calls to the scripts will be made at the same time. All of the scripts will load at the same time. In this case, if a script hangs up, it will not stop the other scripts from loading.

![All\_About\_Tags\_04.png](https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2Fgit-blob-130ca34879dd7aac7a0ff9320b2dd1a3a1948f07%2F7a5ba107aceae26d1b20b44a281d238a.png?alt=media)

The disadvantage of an asynchronous tag is that the screen may seem to flicker if the modifications are applied after the website loads.

In most cases, **we recommend using the synchronous tag for AB Tasty.** If the tag is placed in your website’s **\</head>** tag, you will be sure that your modifications will be applied immediately, before the website loads. This will avoid the flickering effect and will offer an optimal user experience.

### **Compatibility matrix** <a href="#id-01h7sfp5zkmvw462f4axv84wp0" id="id-01h7sfp5zkmvw462f4axv84wp0"></a>

| **AB Tasty module**                                   | **Compatibility**                                                                                                                                                                                                                                                                                                                            |
| ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>Dashboard</p><p>WYSIWYG editor</p><p>Reporting</p> | <p>The two latest major versions of Chrome and Firefox</p><p>Safari, Internet Explorer, Microsoft Edge, and Opera <strong>are not supported.</strong></p>                                                                                                                                                                                    |
| JavaScript tag                                        | <p>Built for browsers that represent more than 0.5% of the current market share and that are not IE 11 or Opera Mini.</p><p>Babel rule: <a href="https://browsersl.ist/#q=%3E0.5%25%2C+not+ie+11%2C+not+op_mini+all">>0.5%, not ie 11, not op\_mini all</a></p><p><strong>Not compatible with any versions of Internet Explorer</strong></p> |

### **Where to install the generic tag** <a href="#h_01gg77bk1k592sdtncvn7sexcq" id="h_01gg77bk1k592sdtncvn7sexcq"></a>

**The tag must be added to every page, checkout included**. This enables us to measure whether your objectives are attained or not, even if they do not relate to the page being tested. For example, you can test a revised design for your product page, and measure its impact on your conversion rate, which happens later on, on the checkout confirmation page. Furthermore, if the tag is not present on all of the pages, the calculations of some indicators such as the bounce rate or the time may be skewed.

### **The option jQuery Library** <a href="#h_01gg77cx5x6m5zz5kv69swt4vb" id="h_01gg77cx5x6m5zz5kv69swt4vb"></a>

By activating this option, the jQuery library will be loaded with the tag.

Note that it's not mandatory to install the library jQuery to make AB Tasty work on your website.

There are three options for configuring jQuery loading in the [**framework page**](https://app2.abtasty.com/settings/framework).

* Load AB Tasty’s jQuery
* Do not use jQuery
* Load my jQuery\
  ![](https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2Fgit-blob-697d9b26d6616e204dff6222b773b58a58498e9f%2Ffeed7230c42f32a3e5614e598540bc7d.png?alt=media)

#### Load AB Tasty’s jQuery <a href="#h_01j5xbp0m96nj6phfqw3vj3cyq" id="h_01j5xbp0m96nj6phfqw3vj3cyq"></a>

This option is enabled by default. It enables you to load the AB Tasty jQuery library in addition to any existing library on your website.

#### Do Not Use jQuery <a href="#h_01j5xbp5kga2ps1rms4a30dyvn" id="h_01j5xbp5kga2ps1rms4a30dyvn"></a>

This option disables all jQuery libraries on your website.

#### Load My jQuery <a href="#h_01j5xbpbmwfcph7xy0p5thywzr" id="h_01j5xbpbmwfcph7xy0p5thywzr"></a>

This option enables you to load only your version of jQuery and disable the AB Tasty library.

This decreases the weight of the AB Tasty script by 30 KB.

**Good to know 💡**

In this case, the AB Tasty tag must be placed after your jQuery call in the source code of your pages and you must be using version 3.7.1 of this framework or above.

### **Automatic Reload option** <a href="#h_01gg77dvygwmk4wphffgv0chsn" id="h_01gg77dvygwmk4wphffgv0chsn"></a>

By default, our tag will continue looking for the URL of the current page. If the URL is modified, then it will trigger a complete reload of the engine. This is useful for handling Single Page Applications.

If you do not need this feature, you can safely disable it in the [**framework page**](https://app2.abtasty.com/settings/framework)**.**

![](https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2Fgit-blob-5c0204fb668431eabdd43207509d4988e9781e7c%2Fa77f4b5a5865c953808eec20b539fa58.png?alt=media)

### Disabling the tag: clear Script functionality <a href="#h_01gg77es8m3mb5y6y125a5p3ez" id="h_01gg77es8m3mb5y6y125a5p3ez"></a>

![](https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2Fgit-blob-82fe7c5f5845c9fc0aef274cfa6fe6ebb0dec2ed%2Fd4269d7b793fac90d451dc72497e81f7.png?alt=media)

To allow you to see whether AB Tasty causes errors on your website, you can deactivate the tag and empty the script in the [**framework page**](https://app2.abtasty.com/settings/framework).

It deletes the content of the JavaScript file that is normally called to apply the modifications. In other words, the AB Tasty tag is still present on your website, but the file it calls is empty of any JavaScript instructions. Therefore, it cannot cause any errors on your website.

If errors persist on your website after you have emptied the AB Tasty script, you can eliminate AB Tasty from your investigations and look for other sources of errors.

The entire AB Tasty folder is emptied of its content within **two minutes.**

{% hint style="warning" %}
***Emptying the AB Tasty script does not delete the tests from your account;*** they are just temporarily deactivated. Furthermore, the report data is not deleted either.
{% endhint %}

Once you have debugged your website, you should restore the AB Tasty script so you can continue to run your tests. To do so, click the warning message at the top of the interface. After a few minutes, AB Tasty will be operational again and your tests will start running.

![](https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2Fgit-blob-4a820a4d4ebbd483a77d2ccad0258db4b3f55d37%2Ff2f1b56c6ba3b9e1efdcc4a8ef0d2f6d.png?alt=media)

## Multi-Accounts tags <a href="#h_01gg77f6zwjmycfrez564fdyv9" id="h_01gg77f6zwjmycfrez564fdyv9"></a>

For each account, you get access to **a unique tag** **linked to a unique database and a unique set of parameters.** This uniqueness is identified by a hash: your account identifier.

You can find this identifier in your tag URL. For example, in the following tag URL: ***<https://try.abtasty.com/xxxxe47a06be564e44e72092b47cxxxx.js>*** the identifier is ***xxxxe47a06be564e44e72092b47cxxxx.***

You can also find the identifier on your website where your tag is operating by typing the following command in the console:

<pre><code><strong>ABTasty.accountData.accountSettings.identifier
</strong></code></pre>

Campaigns and collected data are not shared between your different accounts. It is only attached to the account it has been collected for.

You can have multiple accounts to separate your domains, your environments, or your regions. However, keep in mind that not only the data will not be shared but you will also not be able to display the same experience to a unique visitor among all the accounts since he will be considered a new visitor.

## Specific Implementations <a href="#h_01gg77fmdpne43h57gktk0gt4j" id="h_01gg77fmdpne43h57gktk0gt4j"></a>

### **Cross-Domain Tracking** <a href="#id-01h7sfp5zk9yv64snzqna870gn" id="id-01h7sfp5zk9yv64snzqna870gn"></a>

Cross-domain tracking helps you follow the user in the case when one or more pages are hosted on a different domain name than the original one. Cross-domain tracking is necessary when a website has a page (payment confirmation, for example) that redirects the user to an external domain. To set-up a cross-domain tracking, go on this [**page**](https://app2.abtasty.com/settings/tracking/cross-domain) on the settings.

You can add a URL pattern as a setting for pages hosted on other domains. Then, click **Add** and validate your modification.

![](https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2Fgit-blob-e2bb5271cd241cf88b2c1f978d4ab11132e2aa18%2Fa1aee8a77f3886c0f7c2885889d61d0f.png?alt=media)

**Heads up ⚡**

**Since cross-domain tracking is relying on third-party cookies to operate, the feature will no longer work on browsers or environment that don't support these cookies anymore**. It can be the browser type (Safari or Firefox), specific settings, the use of extensions or any other external element that might block third-party cookies. This feature is still supported by Google Chrome for the moment. All visitors that are not using a browser or environment compatible with third-party cookies won't be tracked over domains, even when the feature is properly set up.

### **Server-Side Rendering** <a href="#id-01h7sfp5zkebwt7xrncr1d9rav" id="id-01h7sfp5zkebwt7xrncr1d9rav"></a>

If you are using server-side rendering (SSR) on your website, you might need to add a specific implementation for your tag.

In some situations, you might need to ask our tag to wait before applying its modifications. Indeed, with some SSR frameworks, modifying the DOM before the reconciliation has occurred might cause performance or render issues.

You can force our tag to lock its execution until you unleash the tag. To achieve that, you need to declare a variable before injecting our tag:

<pre><code><strong>window.lockABTastyTag = true;
</strong></code></pre>

Once you consider your page to be ready for front-end modifications, you can call the following method to unleash our tag:

<pre><code><strong>window.unlockABTasty();
</strong></code></pre>

For more information, please refer to the [**complete technical documentation** ](https://developers.abtasty.com/docs/tag/tag-window#locking-tag-execution)about global methods and variables or our [**troubleshooting article**](https://developers.abtasty.com/docs/tag/tag-cross-domain-tracking) on cross-domain tracking limitations.

## How to interact with the tag <a href="#h_01gg77g31k0q6v93n89qvk3xyb" id="h_01gg77g31k0q6v93n89qvk3xyb"></a>

When our tag is running on a website, it offers a set of variables, constants, functions, and methods you can use to interact with it.

Everything is hosted under the **window\.ABTasty** object. Here are the most convenient ones you might need:

<pre><code><strong>ABTasty.accountData.tests
</strong></code></pre>

In this object, you will find all the tests that are currently active on your accounts. It displays more information than you would usually need for standard usage but this is convenient to have if you need to dig into your tests.

<pre><code><strong>ABTasty.results
</strong></code></pre>

This object is a simplified version of the **ABTasty.accountData.tests** object. It will display your active tests with a focus on their current status. Are they running? If not, why have they been rejected? This is the most common object you might use to debug and QA your tests.

<pre><code><strong>ABTasty.getTestsOnPage()
</strong></code></pre>

This object will display tests that are currently running on the page.

<pre><code><strong>ABTasty.visitor.id
</strong></code></pre>

This object will return the visitor ID for the current visitor.

<pre><code><strong>ABTasty.getCampaignHistory()
</strong></code></pre>

This object will return the campaign history for the current visitor. The campaign history is all the campaignID/variationID pairs that the visitor is currently assigned to.

<pre><code><strong>ABTasty.accountData.accountSettings
</strong></code></pre>

This object will contain all the settings of the account running on the website. It is convenient to get the identifier, the account name, or various settings, such as framework version or storage mode.

Please find more in these two articles from our developers portal:

* [**Tag window AB tasty**](https://developers.abtasty.com/docs/tag/tag-window-abtasty)
* [**Tag window**](https://developers.abtasty.com/docs/tag/tag-window)

## What the tag tracks <a href="#h_01gg77gmz1jffq855cdxtpsnvs" id="h_01gg77gmz1jffq855cdxtpsnvs"></a>

### **General Tracking** <a href="#id-01h7sfp5zk0sqwd6mhzyb49tr2" id="id-01h7sfp5zk0sqwd6mhzyb49tr2"></a>

[**Technical details about tracking**](https://developers.abtasty.com/docs/data/universal-collect/uc-hits) can be found in the developer portal.

By default and simply by implementing it on your website, our tag is designed to collect browsing data about your visitors. There are four main categories of automated hits:

* Campaign
* Pageview
* dataLayer
* Batch

#### Campaign <a href="#id-01h7sfp5zkzpjmqydxj636d6sf" id="id-01h7sfp5zkzpjmqydxj636d6sf"></a>

Each time a campaign is seen by the visitor, a campaign hit is sent with the corresponding campaign ID/variation ID pair. One hit is sent per campaign.

Each time a campaign hit is sent, the analytics integration settings are triggered.

Each time a campaign hit is sent, a corresponding event is sent. You can [**listen to this event**](https://developers.abtasty.com/docs/tag/tag-javascript-events#executed-campaign-.) for advanced integration.

#### Pageview <a href="#id-01h7sfp5zk5prxbse3a236akrc" id="id-01h7sfp5zk5prxbse3a236akrc"></a>

Every time the visitor visits a page, this hit is sent with all the details about the visited page.

#### dataLayer <a href="#id-01h7sfp5zkrthz0r7d0e20fzyc" id="id-01h7sfp5zkrthz0r7d0e20fzyc"></a>

If you have configured a data layer integration, then a hit will be sent once per session with all the available data layer keys.

#### Batch <a href="#id-01h7sfp5zkzbh11v3n4r730scj" id="id-01h7sfp5zkzbh11v3n4r730scj"></a>

To reduce its global footprint and increase performance, our tag sends the information in batches when they are triggered close to each other. When a batch hit is sent, you can find the usual details about each type of hit directly into the **h** parameter of the payload.

With a standard usage of AB Tasty, you should not be needed to implement any of these hits by yourself.

### **Events** <a href="#id-01h7sfp5zktkvj7s3mycr3axj5" id="id-01h7sfp5zktkvj7s3mycr3axj5"></a>

You can send any event to the collection pipeline. This EVENT type of hit is built according to the following pattern: category/action/label/value.

#### Category <a href="#id-01h7sfp5zkek3x2gys3yjgmvex" id="id-01h7sfp5zkek3x2gys3yjgmvex"></a>

You are free to set the value of your choice in the event category. However, if you want the event to be used in the reporting as a goal or a filter, it must be set as **Action Tracking**.

#### Action <a href="#id-01h7sfp5zm654p1jsrsmmf30pz" id="id-01h7sfp5zm654p1jsrsmmf30pz"></a>

The action is the name of your event as it will be displayed in the goals section, the reporting, or the filters.

#### Label <a href="#id-01h7sfp5zmweww19ehty5j9d6v" id="id-01h7sfp5zmweww19ehty5j9d6v"></a>

A label enables adding text to the hit.

#### Value <a href="#id-01h7sfp5zmdmdn5xm88xvgkj77" id="id-01h7sfp5zmdmdn5xm88xvgkj77"></a>

A value enables adding value to the hit.

#### Format <a href="#id-01j5xchdnx2ymbeypw6k0hht9t" id="id-01j5xchdnx2ymbeypw6k0hht9t"></a>

An EVENT hit must be sent using the following format:

```
window.abtasty.send("event", {
 ec: "Action Tracking",
 ea: "Click on CTA",
 el: "CTA on product page",
 ev: 1
});
```

For further information, please refer to this [**article**](https://developers.abtasty.com/docs/data/uc-hits#event).

#### Shortcut <a href="#id-01h7sfp5zmw5czdw8rq9tcb66z" id="id-01h7sfp5zmw5czdw8rq9tcb66z"></a>

You can also use the following method if you only need to send the action (name of a goal).

```
ABTastyClickTracking({{action}}, null);
```

## How to follow your tag performance <a href="#id-01j5z3v0116by1e6sewcpk20rq" id="id-01j5z3v0116by1e6sewcpk20rq"></a>

You will find [a performance center inside the AB Tasty platform](https://app2.abtasty.com/settings/performance-center/guidelines): it's useful to understand your tag's weigh and find ways to improve it (custom recommendations regarding your specific activities).

For more information about performance center and guidelines, please refer to the following articles:

* [**Perfomance center**](https://support.abtasty.com/hc/en-us/articles/6515682707612)
* [**List of performance guidelines**](https://support.abtasty.com/hc/en-us/articles/13512369884956)

## Joining the AB Tasty "Next tag program" <a href="#id-01h7sfp5zkkveg4yvjb0ffeq57" id="id-01h7sfp5zkkveg4yvjb0ffeq57"></a>

**The Next tag is our Early Adopter program for the AB Tasty tag**. It is a specific and early branch, where we put our **latest optimizations and features** that have been internally tested and validated but that are awaiting a more global validation (early adopter feedback) before being deployed to all users.

By joining the program, you will be able to test our latest improvements and new features instantly.

### How to join the program? <a href="#id-01h7sfp5zkfajsv63cfdj7tsem" id="id-01h7sfp5zkfajsv63cfdj7tsem"></a>

In the [Framework](https://app2.abtasty.com/settings/framework) section of your AB Tasty account, you can see which branch of the tag you are on. We currently have 3 branches running:

* ***Latest***: the public and most used branch, referred to as the “default” branch;
* ***Next***: the early and advanced branch you are able to test;
* ***Unstable***: an experimental and internal branch. On a normal use, you will never see this branch.

If your tag is set on *Latest*, you are free to join the Next program by clicking *Learn more* and *Join now* from the popin. However, you can’t join the program on your own if you are on the *Deprecated* or *Unstable* branch.

![](https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2Fgit-blob-3efc33e92f8e083bfe7309bf0c5e1311cf3b2b65%2F430c4c1c4e740c941724f10a8d355011.png?alt=media)

After joining the *Next* program, you must refresh your tag to push the modifications live. Otherwise, the changes will be pending.

### How to leave the program? <a href="#id-01h7sfp5zks68qj3jhfxv9yy9c" id="id-01h7sfp5zks68qj3jhfxv9yy9c"></a>

From the *Framework* section, if you are already on the *Next* tag, you can choose to instantly leave the program by clicking *Leave program*. You will be able to rejoin the program anytime.

After leaving the program, you must also refresh your tag to push the modifications live. Otherwise, the change will be pending and you will still be operating on *Next*.

Note that since this version of Next is impacting the cache mechanism, switching back to Latest might cause an additional delay in your ability to push new modifications to your website. **This delay can go up to 24 hours**.

![](https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2Fgit-blob-7f343e404a6ee15209a2af6c880f9857a21ec910%2Fd591e9780bef85c58051306f8ae291c8.png?alt=media)

### **What improvements are included in the&#x20;*****Next*****&#x20;tag?** <a href="#id-01h7sfp5zkvrh2a79186a8mrv1" id="id-01h7sfp5zkvrh2a79186a8mrv1"></a>

In the third iteration of Next, launched in Autumn 2023, there is only one major improvement.

***Enhanced cache mechanism***

The tag is now massively using the browser cache to drastically reduce the amount of data being downloaded from our CDN, reducing the latency and thus increasing page speed and improving our impact on your performance metrics but also decreasing the power consumption of our tag.

All files are now cached, for up to 12 months, and regular update checks are made in the background without being render-blocking. If a change in your campaigns or account configuration is detected, it will be downloaded at a low priority in an asynchronous mode.

This means that after the first page, which is the only moment when a new visitor has to download the full bundle, the AB Tasty tag is read directly from memory instead of doing regular polls to the network, reducing its loading time to a few milliseconds.

***Are there any limitations?***

The first page is not impacted by the improvement as the full bundle still needs to be downloaded if there are no cached files. The impact is only visible on the 2+ pages. If you run a performance audit, it is most likely that you will run it without any cache and the improvement won't be noticeable.

Also, as the updates are made in the background, it is most likely that you will experience an additional delay when pushing new modifications in your AB Tasty account. This delay is limited to the new page refresh only.

***Is it changing the way AB Tasty works?***

No. Your dashboard will remain the same and you will keep using AB Tasty in exactly the same way.

You might notice minor changes in the way of QAing your campaigns or investigating the tag on your website. However, if you aren’t a tech-aware user, you shouldn’t spot any differences.

***Is it safe?***

It is safe. However, keep in mind that it is an early version for a reason. It has been tested internally, as well as with several customers that have already joined the *Next* program. We can’t assume we have been running this tag on 100% of the possible configurations and environments. This means you might fall under a configuration that breaks our tag, even though it shouldn’t happen. The worst-case scenario is that your campaigns and data collection will no longer work. By joining the *Next* program, you accept the tiny possibility that something may go wrong.

In any case, you can switch back to the *Latest* tag at any time without notifying us (but we expect your feedback!). Just remember to always refresh your tag after you make a change. **Due to the nature of the change in Next 3,** you should be aware that **an additional delay will apply before being able to push new changes in production** when switching back to Latest. **This delay can go up to 24 hours**.

***Will there be a new iteration of the Next branch?***

Yes, and it is already planned for the future. This version is already the third iteration of our *Next* program. It is most likely that a fourth iteration will come after we decide to close this one.

When closing the second iteration, we decided to automatically migrate back all *Next* users to *Latest.* We will keep you posted about the end of the current iteration.

## Transaction Tag <a href="#id-01h7sfp5zmygebbmy14ceh68hs" id="id-01h7sfp5zmygebbmy14ceh68hs"></a>

AB Tasty lets you collect **the data related to transactions made on your website** (e.g. transaction amounts, payment methods, number of purchased items, etc.), along with information related to the purchased items (average cart value, item price, etc.).

This data is **available in the reports of each campaign** in the form of indicators or filters. For more information, refer to our guides on metrics.

To send transaction data to AB Tasty and display it in the reports, you need to add the transaction tag to your purchase confirmation page. This tag should be added after the generic AB Tasty tag.

You can implement the transaction tag in three different ways.

Once the transaction tag is implemented on your website, you can go ahead and run the QA process. For further information, refer to **QA the Transaction Tag** section above.

### **Accessing the Transaction Tag** <a href="#id-01h7sfp5zm17sm69fjcaet1te8" id="id-01h7sfp5zm17sm69fjcaet1te8"></a>

In the page [Transaction tag](https://app2.abtasty.com/settings/installation-code/e-commerce), you'll find the code to paste into the purchase confirmation page.

### **Tag Composition** <a href="#id-01h7sfp5zm81ygm2793qy722yr" id="id-01h7sfp5zm81ygm2793qy722yr"></a>

The transaction tag features two parts: the first part enables the transmission of information related to the transaction (ID, name, amount, delivery fees, etc.) and the second part enables the transmission of the item or product details related to purchases made by customers visiting your website.

### **Transaction Settings** <a href="#id-01h7sfp5zmg3d8nf69p933g8p0" id="id-01h7sfp5zmg3d8nf69p933g8p0"></a>

The transaction settings correspond to the general information related to a purchase. If necessary, this information can be enriched with settings related to items.

{% hint style="warning" %}
**Heads up ⚡**

**tid, ta, tr,** and **icn** settings must be declared during transaction tag implementation. The other settings are optional. However, we recommend configuring them as well so that you can apply the matching filters to the reports later on.
{% endhint %}

| **Parameter name** | **Meaning**             | **Definition**                                                                           | **Example**    |
| ------------------ | ----------------------- | ---------------------------------------------------------------------------------------- | -------------- |
| **tid**            | Transaction ID          | Transaction ID                                                                           | tid: "OD564"   |
| **ta**             | Transaction affiliation | Name assigned to the transaction as it will appear in the list of goals to be configured | ta: "Purchase" |
| **tr**             | Transaction revenue     | Transaction amount. Includes taxes and delivery fees.                                    | tr: 15.47      |
| **ts**             | Transaction shipping    | Delivery fees to be paid.                                                                | ts: 3.5        |
| **tt**             | Transaction tax         | Transaction fees to be paid                                                              | tt: 2.60       |
| **tc**             | Transaction currency    | Currency used for the transaction                                                        | tc: "EUR"      |
| **tcc**            | Transaction coupon code | Discount coupon used for the transaction                                                 | tcc: "Coupon"  |
| **pm**             | Payment method          | Payment method used for the transaction                                                  | pm: "Paypal"   |
| **sm**             | Shipping method         | Shipping method                                                                          | sm: "Fedex"    |
| **icn**            | Item count number       | Total number of items purchased during the transaction                                   | icn: 12        |

**Good to know 💡**

Information relating to the transaction amount and currency is collected, but no currency conversion is performed. The values are displayed in the report just as they are collected on the websites.

For further information on the JavaScript implementation of transaction settings, refer to our [**developer documentation**](https://developers.abtasty.com/docs/data/universal-collect/uc-hits#transaction)***.***

### **Item-Specific Settings** <a href="#id-01h7sfp5zmkfgmy2hh9k324ykh" id="id-01h7sfp5zmkfgmy2hh9k324ykh"></a>

Information related to the purchased items can be linked to each transaction. To do this, you need to configure the **item** section of the transaction tag using the settings below in addition to those related to the transaction.

**Heads up ⚡**

**tid** and **in** settings must be declared. In particular, **tid** setting must match the one declared for the main transaction.

| **Parameter name** | **Meaning**    | **Definition**                                                                            | **Example**  |
| ------------------ | -------------- | ----------------------------------------------------------------------------------------- | ------------ |
| **tid**            | Transaction ID | Transaction ID                                                                            | tid: "OD564" |
| **in**             | Item name      | Item name                                                                                 | in: "Shoe"   |
| **ip**             | Item price     | Item price                                                                                | ip: 3.5      |
| **iq**             | Item quantity  | Number of times an item was purchased during the transaction                              | iq: 4        |
| **ic**             | Item code      | Item’s CKU (stock-keeping unit), i.e. the item’s reference code used for stock management | ic: "SKU47"  |
| **iv**             | Item category  | Category the item belongs to                                                              | iv: "Blue"   |

For further information on the JavaScript implementation of settings related to items, refer to our [**developer documentation**](https://developers.abtasty.com/docs/data/uc-hits#item).

### **Three Ways of Implementing the transaction Tag** <a href="#id-01h7sfp5zmy0zmf47b4sdk380s" id="id-01h7sfp5zmy0zmf47b4sdk380s"></a>

The transaction tag can be implemented in four different ways:

* **Option 1 -** [**With the Transaction Tracking via dataLayer**](https://docs.abtasty.com/~/revisions/jp976foDpdJWagLtM22v/account/transaction-tag-integration/how-to-create-a-transaction-tracker-via-datalayer) which uses your dataLayer (**Google** **Tag** **Manager**, **Tealium** or **CommandersAct** to collect data (medium level of complexity)
* **Option 2:** [**With the dedicated code**](https://docs.abtasty.com/~/revisions/jp976foDpdJWagLtM22v/transaction-tag-integration/how-to-implement-the-transaction-tag#h_01j8etnehcx8fcyjxz7yx3myy8) (advanced level of complexity - a developer is needed)
* **Option 3:** [**Via a Tag Management System**](https://docs.abtasty.com/~/revisions/jp976foDpdJWagLtM22v/transaction-tag-integration/how-to-implement-the-transaction-tag#id-01j2c1xzepmwzjky8ew1pn2n7y) (TMS - advanced level of complexity - a developer is needed)
* **Option 4:** [**With the Shopify app**](https://docs.abtasty.com/~/revisions/jp976foDpdJWagLtM22v/transaction-tag-integration/how-to-implement-the-transaction-tag#id-01j8fb4vj6me4bmw5ct7c250hx) (one click activation) if you are using Shopify as your CMS.

#### Example of code implementation <a href="#id-01h7sfp5zmztvwaadjs06k18h3" id="id-01h7sfp5zmztvwaadjs06k18h3"></a>

The most effective way to implement the transaction tag is within the source code of your website’s purchase confirmation page. You can use the code template provided below.

Follow the steps below to implement the transaction tag:

1. Copy all of the code below and paste it into your confirmation page.

{% hint style="warning" %}
**Heads up ⚡** This is the generic transaction tag. Variables are specific to your website.
{% endhint %}

```
// transaction tag
<script>
window.abtasty.send(“transaction”, {
  tid: __TRANSACTION_ID__, // Format: STRING, value example: “OD564"
  ta: __TRANSACTION_NAME__, // Format: STRING, value example: “Purchase”
  tr: __TRANSACTION_REVENUE__, // Format: FLOAT, value example: 15.47
  ts: __TRANSACTION_SHIPPING__, // Format: FLOAT, value example: 3.5
  tt: __TRANSACTION_TAXES__, // Format: FLOAT, value example: 2.60 
  tc: __TRANSACTION_CURRENCY__, // Format: STRING, vLicalue example: “EUR”      
  tcc: __TRANSACTION_COUPON_CODE__, // Format: STRING, value example: “Coupon”
  pm: __TRANSACTION_PAYMENT_METHOD__, // Format: STRING, value example: “Paypal”
  sm: __TRANSACTION_SHIPPING_METHOD__, // Format: STRING, value example: “Fedex”
  icn: __TRANSACTION_ITEM_COUNT_NUMBER__ // Format: INTEGER, value example: 12
});
</script>
// transaction items tag
<script>
window.abtasty.send(“item”, {
  “tid”: __TRANSACTION_ID__, // Format: STRING, value example: “OD564”
  “in”: __TRANSACTION_ITEMS[i].ITEM_NAME__, // Format: STRING, value example: “Shoe”
  “ip”: __TRANSACTION_ITEMS[i].ITEM_PRICE__, // Format: FLOAT, value example: 3.5
  “iq”: __TRANSACTION_ITEMS[i].ITEM_QUANTITY__, // Format: INTEGER, value example: 4
  “ic”: __TRANSACTION_ITEMS[i].ITEM_CODE__, // Format: STRING, value example: “SKU47”
  “iv”: __TRANSACTION_ITEMS[i].ITEM_CATEGORY__ // Format: STRING, value example: “Blue”
});
</script>
```

* Replace the **\_\_TRANSACTION\_\[OBJECT]\_\_**&#x76;alues with your data, available in your source code or data layer.
* Apply the appropriate format to your values (string, float, or integer) as described in our [**developer**](https://developers.abtasty.com/docs/data/uc-hits#transaction) [**portal**](https://developers.abtasty.com/docs/data/uc-hits#transaction).
* Create a loop in the code so that it is triggered as many times as there are items in the transaction.

For Transaction Items, the key/value pair is unique to each item of the transaction.

If the transaction includes more than one item, the Transaction Items must be sent as many times as there are items in the transaction.

The Transaction Items must be sent independently for each item.

#### Recommendations When Implementing in the Source Code <a href="#id-01h7sfp5zmz9wyb3rd4xegk1sk" id="id-01h7sfp5zmz9wyb3rd4xegk1sk"></a>

When implementing in the source code, we recommend the following:

* the names of transaction and item parameters must not be modified;
* when replacing th&#x65;**\_\_TRANSACTION\_\[OBJECT]\_\_** values, do not keep the opening or the closing double underscore **\`\_\_\`**;
* there should always be a comm&#x61;**,** at the end of each line (except for the last line, for which it is not mandatory).
* never place double **“ ”** or single **‘ ’** quotes around the value of the **in** parameter, even if the expected format of the value is a character string;
* implement the transaction tag at the bottom of the page - far from the generic tag. The transaction tag does need to be triggered after the generic tag. However, placing it at the bottom of the page will ensure the generic tag has fired already and that all values the transaction tag relies on have loaded as well.

#### Recommendations When Implementing a Tag Management System <a href="#id-01h7sfp5zm7e10m82bphhkwsec" id="id-01h7sfp5zm7e10m82bphhkwsec"></a>

When implementing via a Tag Management System, we recommend the following:

* always implement the generic tag in the first position at the top of the page, then execute it.
* implement the transaction tag in the second position, i.e after the generic tag.\
  Otherwise, the AB Tasty undefined error message will be displayed.

## How to QA the Transaction Tag <a href="#id-01h7sfp5zmsxk6dqvxfxgkyej3" id="id-01h7sfp5zmsxk6dqvxfxgkyej3"></a>

AB Tasty lets you save the data related to transactions made on your website (e.g. transaction amounts, payment methods, number of items purchased, etc.), along with information related to the purchased items (average cart value, item price, etc.).

To send transaction data to AB Tasty and display it in the reports, you need to add the transaction tag to your purchase confirmation page, after the generic AB Tasty tag.

This data is available in the reports of each campaign in the form of indicators.

Once the transaction tag is implemented on your website, you need to run it through the QA process. This will ensure that for each purchase, the information is correctly collected by the AB Tasty tag and that the transaction goal is visible on the goal configuration page.

#### Verifying That Transaction Data Is Collected Properly <a href="#id-01h7sfp5zm5r212etzyx1339p4" id="id-01h7sfp5zm5r212etzyx1339p4"></a>

There are three different ways to verify the transaction data collection:

* with the QA Assistant,
* with the console’s **Network** tab,
* with the **Application/Local Storage** tab of the console

The first part of the transaction tag generates a **type=TRANSACTION**query and the second part generates a **type=ITEM** query. Use the Chrome browser console to make sure the transaction tag hits are collected properly. Do this via your browser’s **Network** tab, in the **Local Storage** section.

#### *With the QA Assistant* <a href="#id-01h7sfp5zmp43dgzg0qh6d91k1" id="id-01h7sfp5zmp43dgzg0qh6d91k1"></a>

The QA Assistant allows you to QA both tracking and transactions. Transaction data can be found in the dedicated tab:

![All\_About\_Tags\_14.png](https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2Fgit-blob-540d0c98de82c8e4f29939d7084e8fefb0dd7dba%2F7e802c2d91f36fdcc90238bece50bb1f.png?alt=media)

You can place a fake order on your website and access the confirmation page. If the transaction tag is correctly installed, you should see the transaction data accordingly. If nothing is sent to the QA Assistant, it means that data is not collected and that the transaction tag has not been implemented correctly. If that is the case, refer to [***How to implement the transaction tag?***](https://docs.abtasty.com/~/revisions/jp976foDpdJWagLtM22v/account/transaction-tag-integration/how-to-implement-the-transaction-tag) or to the [***Transaction tag FAQ***](https://app.gitbook.com/s/hZIDRsh66I8ikipjy42H/faq/faq-about-the-transaction-tag).

#### *With the Console’s Network Tab* <a href="#id-01h7sfp5zmmq5pqfkp1bz6nc18" id="id-01h7sfp5zmmq5pqfkp1bz6nc18"></a>

Depending on the settings configured when implementing the transaction tag, these will also be listed with the transaction hit.

Follow the steps below to make sure the transaction tag is sending hits properly:

1. Access your website.
2. Open your Chrome browser console.
3. Open the **Network** tab.
4. On the web page, add products to your cart and confirm your purchase.
5. In the console, select the **ariane.abtasty.com** transaction hit.
6. Click the **Headers** tab and make sure the **TRANSACTION** and **ITEM** settings are there.\
   ![All\_About\_Tags\_15.png](https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2Fgit-blob-aa34fa7ec96ea896b5eec8c0379eebae3a8b223e%2Fcd3d58679d3d7afe2df50ae712d4e704.png?alt=media)\
   ![All\_About\_Tags\_16.png](https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2Fgit-blob-65aa1760a0789794bb493a592de6d77cbbbf5b3d%2Fbb51d2a301f71caf50e7dfcbe354d8d5.png?alt=media)\
   \\

{% hint style="info" %}
**Good to know 💡**

The transaction name (**ta**) appears just as you configured it when implementing the transaction tag. The AB Tasty tag automatically fills in the generic settings such as **vid**, **vp**, **ul**, **sn**, **sen**, **sd**, etc. to qualify the hit.
{% endhint %}

#### *With the Application/Local Storage Tab of the Console* <a href="#id-01h7sfp5zmyfgf07m8xvkp6arb" id="id-01h7sfp5zmyfgf07m8xvkp6arb"></a>

You must also make sure the **transaction** and **item** type data has been collected and is present in your browser’s local storage.

Follow the steps below to make sure the **transaction** and **item** type data has been collected and is present in your browser’s local storage:

1. Open the **Application** tab of the console.
2. In the left-hand column, unfold the **Local Storage** entry.
3. Select the ABTastyData key: All transaction and item type information is displayed.

![All\_About\_Tags\_17.png](https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2Fgit-blob-2392bc8b4f79cfe000fba9acbc33527e0b7ba893%2F6d314c46a31f154d782fe4855824a91f.png?alt=media)\
\\

#### Goal Configuration Page <a href="#id-01h7sfp5zmfgnfp5rmsgshnwq7" id="id-01h7sfp5zmfgnfp5rmsgshnwq7"></a>

Once the transaction hit has been collected and the usual processing time is up (between 45 minutes and 4 hours), you can add the transaction goal to your campaigns.\
For further information, refer to the Configuring Goals guide.\
\
![](https://2350286830-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6Yw9IRJ6KbbucQPwZUCZ%2Fuploads%2Fgit-blob-8b6f2cb581de10c30ed54916e9e89cb3e7bb3a92%2F618720eb52ed09259819fc26289d0f22.png?alt=media)

Follow the steps below to add the transaction goal to your campaigns:

1. Create a new campaign in QA mode.
2. Access the **Goals** step of your campaign.
3. Click the **Transaction** goal.
4. Select your transaction goal to add it as a main or secondary goal.

{% hint style="info" %}
**Good to know 💡**\
The goal name matches the value assigned to the **ta** setting during transaction tag implementation.
{% endhint %}

### Clicks Trackings With the Tag <a href="#id-01h7sfp5zmksszh7hjxk245mqs" id="id-01h7sfp5zmksszh7hjxk245mqs"></a>

The tag collects all the trackers you will set up in your campaign.\
For further information on how to set up click tracking, refer to our dedicated content.
