How to implement the Generic Tag

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 this tutorial

How to specify a domain

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

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 , then the domain you need to set here is "my-website.com".
You can't save a domain that is not valid. Common mistakes are including a slash (/) or the protocol (https://).

Subdomains

You can restrict the tag implementation to a specific subdomain. In this case, the tag will refuse to execute on a subdomain that is not listed.

For example, you can set "www.my-website.com" and the tag will only execute on the root domain.

You can set "eshop.my-website.com" and the tag will only execute on this specific subdomain ("eshop").

If you decide to add a subdomain restriction because you have other AB Tasty accounts for the other subdomains, then we strongly advise you to make sure your cookie domain restriction is also up-to-date.

Learn more about domains in this article.

You might have business purposes to need more than 1 domain per account. You can get in touch with your AB Tasty usual contact to explain your situation and request more domains.

If you implement your tag on a domain that is not listed, the tag will simply refuse to execute on all domains that are not listed or subdomains that are excluded. No harm will be done to the said domains and subdomains.

How to implement the generic tag

The generic tag comes in two versions: synchronous and asynchronous. For more information, refer to this tutorial.

Standard Implementation

Copy the content of the synchronous tag and paste it between the </head> tags of your pages. Once the tag has been installed, you do not have to worry about it anymore since this tag is your account tag, not a testing tag.

We recommend that you place the code in the </head> section of your pages so changes are displayed more quickly. Otherwise, a flickering effect may occur: your visitors may see the original page for a fraction of a second before they see the modified page. By calling our tag as high as possible in the source code of your page, our script can apply the changes before the content is displayed.

Custom Implementation

You can also use any Tag Management System to inject our tag. In this case, make sure that the best practices (synchronous, in the </head>, not delayed) are applied, otherwise, you might experience flickering. Please note that some TMS, like Google Tag Manager, do not allow you to follow these guidelines. As stated in their documentation, it is not recommended to use GTM to inject an A/B Testing tag. 

At any moment and for any reason, you can decide not to follow these guidelines. You can place the AB Tasty tag in the </body> tag set it as async, or manually defer it as soon as you accept the flickering effect it could create. Beyond that, you also need to acknowledge the resource-loading mechanism that lies behind your visitors’ browsers. This will enable you to understand when our tag will execute and evaluate your targeting criteria and business rules.

Best practices

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 in the AB Tasty platform and read this article about perfomance guidelines

Was this article helpful?

/