ABTasty object

The ABTasty object is a JavaScript variable containing all the information generate by the tag. It also contains a copy of the datas use by the tag to work.

Type: object

window.ABTasty

Methods

getAccountSettings()

Type: function

Return a JSON object containing information about the client's account and his configuration.

window.ABTasty.getAccountSettings();

Return: AccountSettings

Type: AccountSettings

Key
Type
Description

accountIframeException

boolean

(Optional) Define if tag can be start into an iframe that can access to their parent.

accountName

string

Name of the AB Tasty's account.

addJquery

boolean

Define if jQuery is load by the tag.

ajaxAutoReload

boolean

Define if tag should be reload on URL change.

apiTokenWeborama

string or null

Token used to call Weborama API in case of Weborama DMP is used into a campaign in play.

cedexisRadar

integer

Define if cedexis radar should be used or not. Default and most common value: 0. Possible other value is 1.

customCookieDomain

string or null

Domain on which tag should depose the cookies. In case of null tag will define by itself the domain.

customCookiePath

string

Path on which tag should depose the cookies. Default value: '/'.

datalayerMaxToSend

integer

datalayerVariable

string

(Optional) Name of the variable to use to access to the data layer.

eulerianPixelURL

string or null

URL to use to link AB Tasty and Eulerian. More details

excludeIE

boolean

(Deprecated) No more use by the tag as IE is no more support. More details

frameworkVersion

string

The actual version of the tag.

getAlwaysWeborama

boolean or null

Define if tag should request Weborama datas on each page viewed (true) or only at the first page of the session (false).

globalCode

string

The Javascript put as global code of the account.

globalCodeOnDocReady

boolean

Define if global code should be execute at the DOM ready (true) or directly at the page load (false). Default value: true.

hashMrasnAllowed

boolean

Define if redirection datas should be give by URL parameter (true) or by cookie (false). Default value: true.

heatmapRight

boolean

Define if the account have access to the heatmap feature.

id

integer

Unique ID of the AB Tasty's account.

identifier

string

Unique identifier of the AB Tasty's account.

isSecureCookie

boolean

Define if tag should use the secure option of the cookie. Default value: false.

jqueryVarName

string or null

Name of the variable to use to access to the jQuery install on the website.

kruxNamespace

string or null

omnitureIntegration

integer

(Optional) Type of omniture integration use by the account. Possible values: 0 or 1 or 2. Default value: 0.

oneVisitorOneTest

boolean

Define if account is using the 1 visitor 1 test feature.

pack

string

The type of pack the account is using. Possible values premium or quota.

quota

integer

runAsThread

integer

sessionRecordingRights

boolean

Define account has right to use Session Recording feature.

storageMode

string

Define if ABTasty datas should be saved in to 'cookies' or localStorage (value 'local').

tealiumAccountName

string or null

Name of the Tealium account to use.

tealiumProfileName

string or null

Profile of the Tealium account to use.

toleranceParams

array of strings

The parameters to remove from URL send to the Universal Collect. Useful if you want to not send sensitive datas.

toleranceRegex

string or null

The regex to remove from URL send to the Universal Collect. Useful if you want to not send sensitive datas.

waitForConsent

object

Object containing the configuration of the consent restrictions.

waitForConsent.data

string or object or null

Data to use for each consent mode. String for custom_js and didomi ; Object for specific_cookie or null for other modes.

waitForConsent.isStrict

boolean

Define if the tag should wait the consent before starting.

waitForConsent.campaignRestrictions

object

Object containing the configuration about campaign restriction execution.

waitForConsent.campaignRestrictions.test

boolean

If equal to true the "test" campaigns could be executed ; if false they can't be executed.

waitForConsent.campaignRestrictions.perso

boolean

If equal to true the "personalization" campaigns could be executed ; if false they can't be executed.

waitForConsent.campaignRestrictions.redirection

boolean

If equal to true the "redirection" campaigns could be executed ; if false they can't be executed.

waitForConsent.campaignRestrictions.aa

boolean

If equal to true the "A/A" campaigns could be executed ; if false they can't be executed.

waitForConsent.campaignRestrictions.patch

boolean

If equal to true the "Patch" campaigns could be executed ; if false they can't be executed.

waitForConsent.mode

string

Define which method tag should use before deposit cookie or sending hit. Possible values: 'disabled' or 'custom_js' or 'specific_cookie' or 'any_cookie' or 'user_action' or 'third_party' or didomi.

getTestsOnPage()

Type: function

Return a JSON object containing the datas about the current actives campaigns on the page.

window.ABTasty.getTestsOnPage([campaign_id]);
Argument
Type
Description

campaign_id

integer

(Optional) The campaign Id for which you want the datas.

Return: An object with the campaign_id as key and CampaignPublicType as value.

Type: CampaignPublicType

Key
Type
Description

name

string

The name of the campaign.

status

string

The actual status of the campaign. Possible values: accepted or accepted_by_redirection.

targetings

object

All the datas about the targeting of the campaign.

targetings.qaParamaters.cookie_scope.conditions

object

The conditions of the QA option "Cookie".

targetings.qaParamaters.cookie_scope.success

boolean

Define the success of the QA option "Cookie". Should be true.

targetings.qaParamaters.ip_scope.conditions

object

The conditions of the QA option "IP address".

targetings.qaParamaters.ip_scope.success

boolean

Define the success of the QA option "IP address". Should be true.

targetings.segment

array

All the datas about the segment part of the targeting.

targetings.segment[].audiencePosition

integer

Index in the segments array of the segment to which the criteria belongs to.

targetings.segment[].audienceName

string

Name of the segment to which the criteria belongs to.

targetings.segment[].conditions

object

The conditions of the segment criteria.

targetings.segment[].group

integer

Number of the group segment criteria to which criteria come from.

targetings.segment[].name

string

The name of the segment criteria.

targetings.segment[].operator

string

The operator use between the conditions of the segment criteria.

targetings.segment[].success

boolean

Define the success of the segment criteria.

targetings.segment[].targeting_type

integer

The type of the segment criteria.

targetings.targetPages.code_scope.conditions

object

The condition of the "where" criteria "Code".

targetings.targetPages.code_scope.success

boolean

Define the success of the "where" criteria "Code". Should be true.

targetings.targetPages.selector_scope.conditions

object

The conditions of the "where" criteria "CSS selector".

targetings.targetPages.selector_scope.success

boolean

Define the success of the "where" criteria "CSS selector". Should be true.

targetings.targetPages.url_scope.conditions

object

The conditions of the "where" criteria "URL".

targetings.targetPages.url_scope.success

boolean

Define the success of the "where" criteria "URL". Should be true.

targetings.trigger

array

All the datas about the trigger part of the targeting.

targetings.trigger[].audiencePosition

integer

Index in the triggers array of the trigger to which the criteria belongs to.

targetings.trigger[].audienceName

string

Name of the trigger to which the criteria belongs to.

targetings.trigger[].conditions

object

The conditions of the trigger criteria.

targetings.trigger[].group

integer

Number of the group trigger criteria to which criteria come from.

targetings.trigger[].name

string

The name of the trigger criteria.

targetings.trigger[].operator

string

The operator use between the conditions of the trigger criteria.

targetings.trigger[].success

boolean

Define the success of the trigger criteria.

targetings.trigger[].targeting_type

integer

The type of the trigger criteria.

testDatas

object

A copy of the raw datas used by the tag to make the campaign works. It contains all the information extract from the database for this campaign.

type

string

Type of the campaign. Possible values: ab or subsegment.

variationID

integer

The ID of the actual active variation.

variationName

string

The name of the actual active variation.

getCampaignHistory()

Type: function

Return a JSON object containing all the campaign which are in play and variation seen by the visitor.

window.ABTasty.getCampaignHistory();

Return: SeenCampaigns

Example:

Visitor have seen following campaigns:

  • A/B Test: 246802 - Variation: 346802 (currently in play)

  • A/B Test: 257901 - Variation: 357913 (currently in pause)

  • Sub-Test: 467903 - Variation: 367819 - Master campaign: 467902 - Master variation: 367818 (currently in play)

JSON returned by the function will be:

{
  "246802": 346802,
  "467902": 367818,
  "467903": 367819
}

getGeoloc()

Type: function

Return a JSON object containing the information about the geolocation of the visitor. If the service of Geolocation has never been called, then it return null.

window.ABTasty.getGeoloc();

Return: null | GeolocResponse

:::info

  • The geolocation data is only available when there is at least one of the following targeting criterion used on an active campaign: IP / Geolocation / Weather.

  • The weather data is only available if a weather targeting condition is active for the whole account (any active campaigns). :::

Type: GeolocResponse

Key
Type
Description

accuracy_radius

integer

The approximate accuracy radius, in kilometers, around the latitude and longitude for the geographical entity (country, subdivision, city or postal code) associated with the IP address.

city

string

Name of the city associated with the IP address.

city_confidence

integer

A value from 0-100 representing our confidence that the city is correct.

city_id

integer

A unique identifier for the city as specified by GeoNames.

country_iso_code

string

A two-character ISO 3166-1 country code for the country associated with the IP address.

country_name

string

Name of the country associated with the IP address.

ip_address

string

The requested IP address.

latitude

float

The approximate WGS84 latitude of the postal code, city, subdivision or country associated with the IP address.

least_specific_subdivision.name

string

Name of the least specific region associated with the IP address.

least_specific_subdivision.iso_code

string

A string of up to three characters containing the region-portion of the ISO 3166-2 code for the least specific region associated with the IP address.

longitude

float

The approximate WGS84 longitude of the postal code, city, subdivision or country associated with the IP address.

most_specific_subdivision.name

string

Name of the most specific region associated with the IP address.

most_specific_subdivision.iso_code

string

A string of up to three characters containing the region-portion of the ISO 3166-2 code for the most specific region associated with the IP address.

postal_code

string

A postal code close to the user’s location.

state

string

state_iso_code

string

time_zone

string

The time zone associated with location, as specified by the IANA Time Zone Database.

weather.temperature

float

(Optional) Temperature in Celsius.

weather.main

string

(Optional) Group of weather parameters (Rain, Snow, Extreme etc.).

weather.description

string

(Optional) Weather condition within the group.

For more details you can check the Maxmind documentation here.

getParsedUserAgent()

:::caution Deprecated method please prefer to use window.ABTasty.getParsedUserAgentAsync(). :::

Type: function

Return a JSON object containing the information about the device and browser of the visitor. If the service of UserAgent has never been called, then it return null.

window.ABTasty.getParsedUserAgent();

Return: undefined | UAResponse --> UAResponse details

getParsedUserAgentAsync()

Type: function

Return a promise to get a JSON object containing the information about the device and browser of the visitor. If the service of UserAgent has been called yet it return immediatly the object, if not is gonna to make the call and return the data after if success. If service's call failed it's promise is returning undefined.

(async () => {
  await window.ABTasty.getParsedUserAgentAsync();
})();

Return: Promise<UAResponse | undefined> --> UAResponse details

getAbandonedCart()

Type: function

Returns a promise to get a JSON object containing the information about the last abandoned cart for this visitor. If the service has been already called, it immediately returns the object, otherwise the data is being fetched. If failing, the promise would return undefined.

(async () => {
  await window.ABTasty.getAbandonedCart([identifier, visitorId, reset]);
})();

Return: Promise<AbandonedCartResponse | undefined> --> AbandonedCartResponse details

Parameters:

Name
Type
Description

identifier

string

(Optional) The ID of the account you are getting data from. By default, the tag will use the current identifier window.ABTasty.accountData.accountSettings.identifier.

visitorId

string

(Optional) The visitor ID you are getting data from, should be linked to the identifier. By default, the tag will use the current id window.ABTasty.visitor.id.

reset

boolean

(Optional) A boolean to define if you want to reset the internal memory of the tag. Remember to remove the ABTastyAbandonedCart session storage entry if you need fresher data from the remote source. Default value: false.

clearSessionCookie()

:::danger Do not use this function on production code. It's mainly for QA and debugging purpose. :::

Type: function

Remove the ABTastySession cookie.

window.ABTasty.clearSessionCookie();

clearCookie()

:::danger Do not use this function on production code. It's mainly for QA and debugging purpose. :::

Type: function

Remove the ABTasty cookie.

window.ABTasty.clearCookie();

clearAllCookies()

:::danger Do not use this function on production code. It's mainly for QA and debugging purpose. :::

Type: function

Remove the ABTasty and ABTastySession cookies.

window.ABTasty.clearAllCookies();

WeboramaCallback

:::danger Do not call this function by yourself. It's for a Tag usage only. :::

Type: function

Allow the Tag to know when Weborama data are successfully fetched.

window.ABTasty.WeboramaCallback(data);
Argument
Type
Description

data

object

Data provide by Weborama about the audiences to which visitor is affected.

TealiumCallback

:::danger Do not call this function by yourself. It's for a Tag usage only. :::

Type: function

Allow the Tag to know when Tealium AudienceStream data are successfully fetched.

window.ABTasty.TealiumCallback(data);
Argument
Type
Description

data

object

Data provide by Tealium AudienceStream about the audiences to which visitor is affected.

Variable properties

started

Type: boolean

Define if the tag has started its execution (true) or not (false). If its execution is limited by a cookie restriction policy, it is still considered as started.

started can be false or not defined when:

  • editor is loading

  • preview is loading

  • tag is locked with window.lockABTastyTag

  • strict mode is on

  • quota is overrun

  • ....

window.ABTasty.started

accountData

Type: object

A copy of all the raw datas used by the tag to work (settings of the account / campaign configuration / widgets code etc.).

window.ABTasty.accountData
Key
Type
Description

accountSettings

object

All the datas about account and its configuration. See getAccountSettings().

crossDomainSettings

object

Settings about the cross-domain tracking feature

crossDomainSettings[].url

string

Value to match with current URL to define if cross-domain tracking feature should be used on the page.

crossDomainSettings[].method

string

Method to compare current URL and value. Possible values: substring or regex or exact.

crossDomainSettings[].includeOrExeclude

string

Define if we should activate the feature on the current page (include) or not (exclude).

customVariables

array

Datas about automatic visitor attributes to send based on the URL of the current page.

customVariables[].action

string

The value of the visitor attribute.

customVariables[].category

string

The name of the visitor attribute.

customVariables[].method

string

The method to determine if segment hit should be send. Possible values: substring or regex or exact.

customVariables[].url

string

The value to use during comparaison with URL.

obsoletes

array

The campaign IDs that have been paused since more than 14 days and less than 126 days.

tests

object

The datas of the campaigns currently in play.

widgets

object

The code of the widgets depending of the version. Only widgets that are used into campaigns in play.

datalayerEnabled

Type: boolean

Define if data layer is defined on the page or not. It's using the ABTasty.accountData.accountSettings.datalyerVariable to check if data layer is defined.

window.ABTasty.datalayerEnabled

visitor

Type: Object

Information about the current visitor. All the information are generated by the Tag and unique to the visitor.

window.ABTasty.visitor
Key
Type
Description

id

string

A unique Id used by AB Tasty to track the visitor. It could be retrieve in the ABTasty cookie.

temporaryCookieValues

Type: Object

Allow the Tag to temporary saved the cookies in case that consent is not ready yet.

window.ABTasty.temporaryCookieValues
Key
Type
Description

ABTasty

string

A copy of ABTasty cookie.

ABTastySession

string

A copy of ABTastySession cookie.

results

Type: Object

Return all the 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.

window.ABTasty.results

Return: An object with the campaign_id as key and CampaignResultsType as value.

Type: CampaignResultsType

Key
Type
Description

name

string

The name of the campaign.

status

string

The actual status of the campaign. Possible values described here.

targetings

object

All the datas about the targeting of the campaign.

targetings.qaParamaters.cookie_scope.conditions

object

(Optional) The conditions of the QA option "Cookie".

targetings.qaParamaters.cookie_scope.success

boolean

(Optional) Define the success of the QA option "Cookie".

targetings.qaParamaters.ip_scope.conditions

object

(Optional) The conditions of the QA option "IP address".

targetings.qaParamaters.ip_scope.success

boolean

(Optional) Define the success of the QA option "IP address".

targetings.segment

array

(Optional) All the datas about the segment part of the targeting.

targetings.segment[].audiencePosition

integer

(Optional) Index in the segments array of the segment to which the criteria belongs to.

targetings.segment[].audienceName

string

(Optional) Name of the segment to which the criteria belongs to.

targetings.segment[].conditions

object

(Optional) The conditions of the segment criteria.

targetings.segment[].group

integer

(Optional) Number of the group segment criteria to which criteria come from.

targetings.segment[].name

string

(Optional) The name of the segment criteria.

targetings.segment[].operator

string

(Optional) The operator use between the conditions of the segment criteria.

targetings.segment[].success

boolean

(Optional) Define the success of the segment criteria.

targetings.segment[].targeting_type

integer

(Optional) The type of the segment criteria.

targetings.targetPages.code_scope.conditions

object

(Optional) The condition of the "where" criteria "Code".

targetings.targetPages.code_scope.success

boolean

(Optional) Define the success of the "where" criteria "Code".

targetings.targetPages.selector_scope.conditions

object

(Optional) The conditions of the "where" criteria "CSS selector".

targetings.targetPages.selector_scope.success

boolean

(Optional) Define the success of the "where" criteria "CSS selector".

targetings.targetPages.url_scope.conditions

object

(Optional) The conditions of the "where" criteria "URL".

targetings.targetPages.url_scope.success

boolean

(Optional) Define the success of the "where" criteria "URL".

targetings.trigger

array

(Optional) All the datas about the trigger part of the targeting.

targetings.trigger[].audiencePosition

integer

(Optional) Index in the triggers array of the trigger to which the criteria belongs to.

targetings.trigger[].audienceName

string

(Optional) Name of the trigger to which the criteria belongs to.

targetings.trigger[].conditions

object

(Optional) The conditions of the trigger criteria.

targetings.trigger[].group

integer

(Optional) Number of the group trigger criteria to which criteria come from.

targetings.trigger[].name

string

(Optional) The name of the trigger criteria.

targetings.trigger[].operator

string

(Optional) The operator use between the conditions of the trigger criteria.

targetings.trigger[].success

boolean

(Optional) Define the success of the trigger criteria.

targetings.trigger[].targeting_type

integer

(Optional) The type of the trigger criteria.

type

string

Type of the campaign. Possible values: ab, multipage, multivariate, mastersegment or subsegment.

sub_type

string

(Optional) Sub-type of the campaign. Possible values: ab, patch, mpt, mvt, sp, mpp or mep.

additionalType

string

(Optional) Additional-type of the campaign computed by the tag (mainly used for consent management). Possible values: aa, patch, or redirection.

variationID

integer or undefined

The ID of the actual active variation.

variationName

string or null

The name of the actual active variation.

consentReady

Type: boolean

Define if AB Tasty's tag has the consent to work and collect (true) or not (false).

window.ABTasty.consentReady

cnilReady

:::caution Deprecated variable please prefer to use window.ABTasty.consentReady. :::

Type: boolean

Define if AB Tasty's tag has the consent to work and collect (true) or not (false).

window.ABTasty.cnilReady

pendingUAParser

Type: boolean

Define if AB Tasty's tag is currently fecthing User-Agent information like device or browser (true) or not (false).

window.ABTasty.pendingUAParser

DCInfos

:::caution Information about geolocation and weather are deprecated. Please prefer to use window.ABTasty.getGeoloc(). :::

Type: Object

A JSON object containing the information about Advalo and Eulerian DMP.

window.ABTasty.DCInfos
Key
Type
Description

DMPInfos

object

Information about DMP Advalo and/or Eulerian

DMPInfos[].partern

string

Id of the partern from which the information come

DMPInfos[].segment

string

The name of the segment define by the DMP

DMPInfos[].value

string

The value of the segment define by the DMP

DMPInfos[].expiration_date

number

The segment expiration date define by the DMP (only for used by Advalo)

urlHistory

Type: Object

Object containing information about current and previous page. (Useful for previous page criteria on SPA websites)

window.ABTasty.urlHistory
Key
Type
Description

current

string

URL of the current page

previous

string

URL of the previous page

ADBlockEnabled

Type: boolean

Define if an adBlocking extension is activating on the browser (true) or not (false).

window.ABTasty.ADBlockEnabled

AdBlockDetectionFailed

Type: boolean

Define if the Tag's detection of an adBlocking extension has failed (true) or not (false).

window.ABTasty.AdBlockDetectionFailed

datalayerEnabled

Type: boolean

Define if the Tag's detection of the data layer has failed (true) or not (false).

window.ABTasty.datalayerEnabled

pendingRedirection

Type: boolean

Define if the Tag's is currently doing a redirection (true) or not (false).

window.ABTasty.pendingRedirection

redirectedFrom

Type: Object

An object containing information about the redirection. Data come from the mrasn query param or from the ABTastySession cookie key mrasn.

window.ABTasty.redirectedFrom
Key
Type
Description

testID

integer

The campaign Id that cause the redirection

variationID

integer

The variation Id that cause the redirection

previousLogicalView

string

The logical view hash of the previous page use to invalidate the hit sent on the original page

appliedPlugins

Type: array

An array containing the Id (string) of the widgets that are currently applied on the page.

window.ABTasty.appliedPlugins

eventState

Type: object

For every JavaScript events dispatched by the tag you can find a status in this variable. You can find a description and an explanation of how to use it in the dedicated documentation.

window.ABTasty.eventState

hitServiceNotifierSubscribe

Type: object

This service is responsible for listening to all the events happening on the client and for making the event and their payload available to use. To subscribe to the event, call the hitServiceNotifierSubscribe method with the following parameters:

window.ABTasty.hitServiceNotifierSubscribe(fn_callback, [event_type], [settings])
Argument
Type
Description

fn_callback

function

Function to execute when the event is emitted ex. ([event_data]: Object, [event_settings]: Object) => void.

event_type

string

(Optional) Event to listen (CAMPAIGN, PAGE, EVENT, SEGMENT, TRANSACTION, ITEM, NPS ).

settings

object

(Optional) all settings data needed by connector (ex. testIds: if you want subscribe to only events for these campaigns, withHitHistory for getting the hit history of current page).

Example:

window.ABTasty.hitServiceNotifierSubscribe(eventData => console.log(eventData)), 'CAMPAIGN', { withHitHistory: true });

event_data is a JSON object containing the following informations:

Key
Type
Description

type

string

type of event

timestamp

integer

Date when event is triggered

data

Object

hit payload

event_settings is a JSON object containing the following informations:

Key
Type
Description

observerId

number

Identifier of subscriber. You can use it to unsubscribe to the notification service

To unsubscribe to the event, call the hitServiceNotifierUnSubscribe method with the following parameters:

window.ABTasty.hitServiceNotifierUnSubscribe(observerId)
Argument
Type
Description

observerId

number

observerId can be obtained from fn_callback's settings

Last updated

Was this helpful?