The following command lines/instructions are compatible with any version of the AB TAsty Generic Tag from 3.0 onwards.
You can determine which test you are currently seeing and which variation you are assigned to by using your web browser’s console.
- Go to the page you wish to verify.
- Display the console (right click+Inspect Element or CTRL+MAJ+ J in Chrome or F12 in Windows).
A navigation bar will open at the bottom or on the side of your screen.
- Select the Console tab.
Example in Chrome: Once the Console tab is open, several instructions (command lines) can be entered.
ABTasty.results will return all campaigns that are live on the website, even if you are not on the right page. In this case, the status will specify if you are seeing a campaign or not, and if not, why you are not seeing it.
The following statuses may apply:
- "accepted" status: you are seeing the test, the name of which is mentioned above
- "audience_rejected" status: you are being rejected from a specific test because you do not match the targeting criteria added to the campaign. To see which targetings you do not match with, click the targetings object listed below the "status" object in the console. Each targeting criterion added to the campaign will be listed in that object and will return true (if you match the criterion) or false (if you do not match the criterion).
- "pending" status: the targeting is set with AJAX mode and the targeting is still waiting for the element to be present on the page before applying; or the targeting includes a geolocation, IP, weather, browser, device, or DMP criterion which has not yet been found.
ABTasty.getTestsOnPage() (parentheses are required!) will return all live campaigns on the page you are currently visiting and for which you match the targeting criteria.
Example in Chrome:
If a campaign that should be listed above is not, you can use ABTasty.results to understand, thanks to the status parameter, why you are not seeing it.
ABTasty.redirectedFrom will return from which redirection campaign you have been redirected from if this is the case. This instruction is available once the redirection has applied, not on the original page.
Understanding the other parameters
- name: name of the campaign you are looking at.
- type: will return the type of campaign (ab - which stands for a/b test -, personalization, multipage, etc.)
- variationID: will return the variation you are currently seeing. 0 always relates to the Original. Any other built-in variation is a 6-digit ID.
- variationName: will return the name of the variation you are currently seeing, as defined in the editor (default names are always "Variation 1", "Variation 2", etc.)/