The Ajax option is a targeting option.
When a page loads, the AB Tasty tag verifies the targeting conditions. At this time, the URL of the page, the elements used to trigger the campaign (ID/Class/Element option), the segment and the trigger defined can be detected. The campaign is only displayed to visitors who meet the targeting conditions.
However, some elements are called after the page has initially loaded, with a slight delay, or after the visitor completes a certain action. This is why, in some cases, they do not appear on your pages once the test is launched.
The Ajax option is useful when your test targeting includes one or several criteria that cannot be verified on page load. For example:
- When using the ID/Class/Element triggering criteria
- When using a segment based on one or several segmentation criteria that are not available on page load such as datalayer variables (which can display after a small delay) or some DMPs.
- When defining a specific custom code in the targeting step to refine the triggering conditions.
For example, on a travel website, the ‘Book’ CTA only appears once the visitor selects their travel dates. Enabling the Ajax option allows the tag to verify the conditions at regular intervals until they are met (when the element is finally loaded and appears).
- If the triggering conditions are met at one point during the multiple verifications, the campaign will be triggered on the page.
- However, if the triggering conditions are never met, the campaign won’t be triggered on the page.
In other words, the campaign is triggered on the page only if the conditions are met at some point of the verification.
⭐ Good to know
To enable the Ajax option, push the toggle button.
💡 Use case
You may want to change the color of the popin that appears when the user clicks Add to cart on the product page of your website. This popin is not natively on your product page but appears after the user completed a specific action. In this case, the Ajax option is necessary. To do so, apply the following steps:
- In the Where section, select single-use URL(s) in the drop-down list.
- Select contains and enter the URL corresponding to your product pages.
- In the How section, select the ID/Class/Element triggering criteria, select ID and enter the ID of your popin.
- Enable the Ajax option.
This way, AB Tasty will verify at regular intervals if the popin appears on the page. When the popin is loaded and appears, the modifications are applied.
For more information, refer to Modify elements of your site which load asynchronously (e.g. AJAX).
Need additional information?
Submit your request at firstname.lastname@example.org
Always happy to help!