> For the complete documentation index, see [llms.txt](https://docs.abtasty.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.abtasty.com/client-side/tag/readme-1/tag-getting-started.md).

# Tag Implementation

### Implementation

Log in to your AB Tasty account and [get your personal snippet](https://app2.abtasty.com/settings/installation-code/tag).

> Synchronous sample example

```javascript
<script type="text/javascript" 
        src="https://try.abtasty.com/3d09baddc21a365b7da5ae4d0aa5cb95.js">
</script>
```

> Asynchronous sample example

```javascript
<script> 
    (function (i, s, o, g, r, a, m) { 
    i["abtiming"] = 1 * new Date(); 
    a = s.createElement(o), 
    m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m) 
    })(window, document, "script", "//try.abtasty.com/3d09baddc21a365b7da5ae4d0aa5cb95.js"); 
</script>
```

The hash in the snippet will be your AB Tasty account `identifier`.

#### Best practices

Our tool needs to be executed quickly as it is going to evaluate its environment (URL, device, datalayer, content of the webpage) to know if it has to execute and display a campaign, resulting in a potential layout shift.\
That's why we recommend to implement our tag as high as possible on your website using the synchronous version to avoid any flickering effect (displaying the original website before the variant).

Putting it in the BODY or forcing him to run asynchronously will higher your risks of having a flickering effect, damaging the user experience on your website.

### QA

#### Check from the network tab

The easiest way to QA your implementation is to have a look in the network tab of your browser. By filtering on the `try.abtasty.com` domain you should be seeing our tag being downloaded.

<figure><img src="https://2625516211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdG0EHdNiO40UVA7Bz9mR%2Fuploads%2Fgit-blob-9779c93d8671d6c166935e1db506bc172c78cf3a%2Ftry-in-console.png?alt=media" alt=""><figcaption><p>QA the tag using the network tab</p></figcaption></figure>

By opening its preview tab, you will have its last update time and its version.

<figure><img src="https://2625516211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdG0EHdNiO40UVA7Bz9mR%2Fuploads%2Fgit-blob-b5d4cf5733e03665ff3d29900a485a3ec2777a30%2Ftag-date-in-console.png?alt=media" alt=""><figcaption><p>Date and version using the preview tab</p></figcaption></figure>

#### Check for the JS object

When correctly executing, our tag creates an `ABTasty` JS object with useful variables and methods.

<figure><img src="https://2625516211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdG0EHdNiO40UVA7Bz9mR%2Fuploads%2Fgit-blob-36330f24e270c38c4f09d26501bf6fa838481fae%2Ftag-js-object.png?alt=media" alt=""><figcaption><p>JS Object in the browser console</p></figcaption></figure>

#### Check for the browser storage

If no storage restriction is set (consent management), the tag will automatically create cookies and entries in the local storage and session storage.

#### Check for the consent

At any moment, you can check if consent for data storage and data collection has been granted by the current visitor. The following variable must be equal to `true` when consent has been given.

```javascript
window.ABTasty.consentReady
```

### Browser compatibility matrix

Our tag is compiled using the following Babel rule:

`>0.5%, not ie 11, not op_mini all`

[Corresponding browsers list](https://browsersl.ist/#q=%3E0.5%25%2C+not+ie+11%2C+not+op_mini+all)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.abtasty.com/client-side/tag/readme-1/tag-getting-started.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
