# How to implement the Generic Tag (comprehensive guide)

To use AB Tasty on your website, you need to install our tag on your website. The generic tag will allow you to apply the JavaScript layer for your page modifications. For more information about tags, please refer to our article [What is AB Tasty Tag?](/account/tag-integration/what-is-the-ab-tasty-tag.md).

The [Tag Implementation Page](https://app2.abtasty.com/settings/installation-code/tag) supports two hosting methods:

1. [AB Tasty Hosted – Default](#option-1-standard-implementation-ab-tasty-hosted)
2. [AB Tasty Delegated](#option-2-ab-tasty-delegated) (to know more about it please read our [tag domain delegation presentation article](/account/tag-integration/understand-ab-tasty-tag-implementation-methods/tag-domain-delegation.md))

Follow these steps to implement the Tag:

{% stepper %}
{% step %}

#### Select your domain

Specifying a domain for your account is mandatory. We recommend to manage one account per domain for performance reasons.

<figure><img src="https://lh7-qw.googleusercontent.com/docsz/AD_4nXfJ6ylCpQ3UjXYwGMKHgWYW0_sa8cOGUyV7AM03BxX73DEOyTa9s4eUOFvcAbrwQbWrCFPUOYPgkjS65XbIutRvLOedMKmwekqG6b99O2SCo9reiDD-DmnQV_RV6ADchbv4iXPP7g?key=7Kv7EpWWNJ01lXGnmObnscyN" alt=""><figcaption></figcaption></figure>

**Domain :** Your domain is everything that goes before the first slash (the path) and after the potential subdomains.\
Hence, if you have implemented your tag on[ www.my-website.com/fr](http://www.my-website.com/fr) , then the domain you need to set here is "my-website.com".

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

You can't save a domain that is not valid. Common mistakes are including a slash (/) or the protocol (https\://).
{% endhint %}

**Subdomain**

When implementing tags, it's possible to restrict their execution to specific subdomains. This ensures that tags will only function on designated subdomains and not on others.

**Subdomain Restriction Examples**

* Root Domain Execution: If you set the tag to "[www.my-website.com](http://www.my-website.com/)," it will only execute on the root domain.
* Specific Subdomain Execution: Setting the tag to "eshop.my-website.com" will restrict its execution to the "eshop" subdomain.

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

* Cookie Domain Restriction: If you apply subdomain restrictions due to multiple AB Tasty accounts across different subdomains, ensure your [cookie domain settings](https://app2.abtasty.com/settings/cookies-privacy/advanced-cookies-settings) are updated accordingly.
* Multiple Domains: For business purposes requiring more than one domain per account, contact your usual AB Tasty representative to discuss your needs and request additional domains.
  {% endhint %}

{% hint style="warning" %}
**Warning**

**Execution Behavior**

If a tag is implemented on a domain not listed, it will not execute on any unlisted domains or excluded subdomains. This ensures no unintended effects on those domains.

For further details, refer to [our comprehensive article about tags](broken://pages/kqhGHAgV5lYeW4ItvmBu).
{% endhint %}
{% endstep %}

{% step %}

#### Choose your hosting method

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

You can switch methods anytime before clicking “I’m done.”

* No data is lost; your settings are preserved.
* Changing a delegated subdomain restarts the delegation flow.
* Switching from Delegated to Hosted requires a confirmation.

For mor information refers to [Understand Tag Domain Delegation](/account/tag-integration/understand-ab-tasty-tag-implementation-methods/tag-domain-delegation.md)
{% endhint %}

The generic tag comes in two versions: synchronous and asynchronous. We recommend synchronous implementation. For more information, refer to [Choose Between Synchronous and Asynchronous methods](/account/tag-integration/understand-ab-tasty-tag-implementation-methods/choose-between-synchronous-and-asynchronous-methods.md)

{% tabs %}
{% tab title="AB Tasty Hosted" %}
This is the by default procedure.

For a step by step procedure, please refer [Set-up the AB Tasty Tag in 5 minutes](/account/tag-integration/implement-ab-tasty-tag/set-up-the-ab-tasty-tag-in-5-minutes.md).
{% endtab %}

{% tab title="AB Tasty delegated" %}
This feature is especially useful for companies with strong security requirements, regulated environments, or those looking to optimize data collection continuity.

To know more about it please read our tag domain delegation presentation article.\
\
For a step by step procedure, please refer to [Tag domain delegation implementation article](/account/tag-integration/implement-ab-tasty-tag/how-to-implement-the-generic-tag/tag-domain-delegation-implementation.md)
{% endtab %}
{% endtabs %}
{% endstep %}

{% step %}

#### Check your implementation

Implementation verification is handled automatically.

Your tag will be refreshed upon validation.

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

To follow your tag performance though time, you can access the performance center in the AB Tasty platform and read this article about perfomance guidelines.
{% endhint %}
{% endstep %}
{% endstepper %}

### **Best practices** <a href="#h_01j5z3dzq7pqk4e7trc3q48ntr" id="h_01j5z3dzq7pqk4e7trc3q48ntr"></a>

These are our recommendations for a good implementation:

* **Prefer the synchronous tag version**
* **Prefer a direct implementation** vs a custom implementation (with a TMS for exemple)
* The tag should be placed in your website’s **\</head>** tag, this way 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

To follow your tag performance though time, you can access the [**performance center**](/reporting-and-performances/performance-center.md) in the AB Tasty platform and read this article about [**perfomance guidelines**](/reporting-and-performances/performance-center/list-of-performance-guidelines.md).


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.abtasty.com/account/tag-integration/implement-ab-tasty-tag/how-to-implement-the-generic-tag.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
