The Ajax option is a targeting option.
📖 Definition
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.
⚙️ Configuration
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
The verification interval is based on the ‘setTimeout’ Javascript function, which verifies the URL targeting first. If the URL doesn’t match the set-up configured in the target pages, the Ajax mode won’t trigger. If it does, the Ajax mode trigger as follows: The targeting configuration is verified (id/class/element, segment, trigger). If the function returns false, which means that conditions are not met, the ‘setTimeout’ function is called and will detect if the element appears after the specified delay. If the element is never detected, the campaign won’t be triggered for the chosen visitor segment.
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 product.feedback@abtasty.com
Always happy to help!
Comments
0 comments
Please sign in to leave a comment.