NAV
Javascript

Object window.ABTasty

Object window.ABTasty

window.ABTasty

The window.ABTasty object provides access to tag data

function getAccountSettings

function window.ABTasty.getAccountSettings()

window.ABTasty.getAccountSettings()

It should return AccountSettings object

Return: AccountSettings

Type AccountSettings

Parameter Value Type Properties Comment
id number readonly
identifier string readonly
region string readonly
accountName string readonly
frameworkVersion any readonly
pack string readonly
quota number readonly
runAsThread number 0 or 1
sessionRecordingRights boolean readonly
addJquery boolean readonly
jqueryVarName string readonly
ajaxAutoReload boolean readonly
excludeIE boolean readonly
hashMrasnAllowed boolean readonly
globalCode string readonly string of code to eval
globalCodeOnDocReady boolean readonly 0 or 1
customCookieDomain string / null readonly
customCookiePath string readonly default is ‘/’
isSecureCookie boolean readonly
oneVisitorOneTest boolean readonly
kruxNamespace null / string readonly
accountIdComscore null / any readonly
accountIdSirdata null / any readonly
makaziAdvertiserId null / any readonly
accountIdTemelio null / any readonly
isLiverampEnabled null / any readonly
eulerianPixelURL null / any readonly
accountIdEasyDmp null / any readonly
accountIdComscore null / any readonly
accountIdComscore null / any readonly
waitForCnil boolean readonly
waitForCnilAction number readonly 0 or 1
waitForCnilCookie boolean readonly
storageMode string readonly ‘local’ or ‘cookies’
cedexisRadar number readonly
datalayerVariable string readonly
datalayerMaxToSend number readonly
tealiumAccountName string readonly
tealiumProfileName string readonly
apiTokenWeborama null / string readonly
getAlwaysWeborama number readonly

function getGeoloc

function window.ABTasty.getGeoloc()

window.ABTasty.getGeoloc()

It should return the same data we have in sessionStorage (Type GeolocResponse). If the service geoloc or ua parser has never been called(e.g. no targeting based on it data), then it should return null.

Return: null | GeolocResponse

function getParsedUserAgent

function window.ABTasty.getParsedUserAgent()

window.ABTasty.getParsedUserAgent()

It should return the same data we have in sessionStorage (Type UAResponse). If the service geoloc or ua parser has never been called(e.g. no targeting based on it data), then it should return null.

Return: undefined | UAResponse

function getTestsOnPage

window.ABTasty.getTestsOnPage()

This function help the client/CSM/TSE and QA team to know which campaigns is currently active on the page. It show them the all the datas of window.ABTasty.results and also all the datas about the campaign.

window.ABTasty.getTestsOnPage(507663)

You can also use it with a parameter which can be the campaign ID, it will only show the specific campaign: window.ABTasty.getTestsOnPage(123456)

function clearSessionCookie

window.ABTasty.clearSessionCookie()

Will remove session cookies

function clearCookie

window.ABTasty.clearCookie()

Will remove cookies

function clearAllCookies

window.ABTasty.clearAllCookies()

Will remove all cookies

Property datalayerEnabled

window.ABTasty.datalayerEnabled

True if datalayer is activated in account settings Type: boolean

Property visitor

window.ABTasty.visitor

Type: Object

Property id

window.ABTasty.visitor.id

Type: string

Property ABTasty

window.ABTasty.temporaryCookieValues.ABTasty

window.ABTasty.temporaryCookieValues.ABTasty

Type: ABTastyCookie

Property ABTastySession

window.ABTasty.temporaryCookieValues.ABTastySession

window.ABTasty.temporaryCookieValues.ABTastySession

Type: ABTastySessionCookie

Property results

window.ABTasty.results

Property pendingRedirection

Type: boolean

Property DCInfos

Property DCInfos

window.ABTasty.DCInfos

Used for story information about DMP. More information about DMP see in integrations

Type: dcInfos

Type dcInfos

Parameter Value Type Information
country string geoloc prop
region string geoloc prop
city string geoloc prop
ip string
weather [dcWeather] geoloc prop
traffic [dcInfosTestTraffic] auto-allocated traffic information

Type dcWeather

Parameter Value Type Information
temperature string
weather string
weatherDetail string

Type dcInfosTestTraffic

Parameter Value Type Information
testID string
globalTraffic string
variationsTraffic [dcInfosVariationTraffic]

Type dcInfosVariationTraffic

Parameter Value Type Information
variationID number
traffic number

Property accountData

Property accountData

window.ABTasty.accountData

Type: AccountData

Property tests

window.ABTasty.accountData.tests

Campaigns which are actives

Type: TestsCollection

Type TestsCollection

TestsCollection = { [id: string]: Campaign } & { global?: CampaignGlobal }

Type Campaign

Parameter Value Type Properties Comment
id number readonly
name string readonly
traffic number readonly
type CampaignType readonly
parentID number readonly
globalCode string readonly
stopOnDate number readonly 0 or 1
lastIncreasedTraffic string readonly
targetingMode string readonly ‘fastest’ or ‘waituntil’
dynamicTrafficGoalId string / null readonly
dynamicTrafficModulation number readonly
audience Audience readonly
scopes Scopes readonly
analytics [Analytic] readonly
widgets [any] readonly
actionTrackings [ActionTracking] readonly
variations Variations readonly
priority number readonly
children [number] readonly / optional
siblings [number] readonly / optional
status Status optional

Type Audience

Parameter Value Type Properties Comment
id string optional
created_at string optional
name string
description string
hidden boolean
targeting_groups [TargetingGroup]
updated_at string optional
updated_by number optional

Type TargetingGroup

Parameter Value Type Properties Comment
id string optional
targetings [Targeting]

Type Targeting

Union type that combine all *Targeting types in one.

export type Targeting =
  | BrowserTargeting
  | ActionTrackingTargeting
  | AdBlockTargeting
  | BrowserLanguageTargeting
  | CampaignExpositionTargeting
  | CodeTargeting
  | CookieTargeting
  | CustomVariableTargeting
  | DaysSinceFirstSessionTargeting
  | DaysSinceLastSessionTargeting
  | DeviceTargeting
  | EcommerceTargeting
  | GeolocTargeting
  | IpTargeting
  | JavascriptVariableTargeting
  | LandingPageTargeting
  | PagesViewedInSessionTargeting
  | PreviousPageTargeting
  | ReturningVisitorTargeting
  | SameDayTargeting
  | ScreenSizeTargeting
  | SessionNumberTargeting
  | SourceTargeting
  | SourceTypeTargeting
  | CurrentUrlTargeting
  | UrlParameterTargeting
  | WeatherTargeting
  | SelectorTargeting
  | KeywordTargeting
  | LastPurchaseTargeting
  | YsanceDmpTargeting
  | TealiumDmpTargeting
  | WeboramaDmpTargeting;

Type Analytic

Parameter Value Type Properties Comment
name string readonly
wave string readonly
tracker string readonly
implementation string readonly / optional
functionName string readonly / optional

Type Scopes

Parameter Value Type Properties Comment
urlScope [CurrentUrlCondition]
codeScope [CodeCondition]
selectorScope [SelectorCondition]
cookieScope [CookieCondition]
ipScope [IpCondition]

Type CurrentUrlCondition

Parameter Value Type Properties Comment
include boolean
value string
condition number undefined / conditions.EQUALS / conditions.CONTAINS / conditions.REGEXP / conditions.IGNORE_PARAMETERS

Type CodeCondition

Parameter Value Type Properties Comment
value string

Type SelectorCondition

Parameter Value Type Properties Comment
include boolean
value string

Type CookieCondition

Parameter Value Type Properties Comment
include boolean
name string
value string optional

Type IpCondition

Parameter Value Type Properties Comment
include boolean
range boolean
from string
id string / number optional
to string optional
description string optional

Type ActionTracking

Parameter Value Type Properties Comment
config string readonly
name string readonly
event string readonly
data string readonly
elementSelector string readonly

Type Variations

Object with numeric keys that contains TypeVariation values

Parameter Value Type Properties Comment
[id: number] [TypeVariation] readonly

Type TypeVariation

Parameter Value Type Properties Comment
id number readonly
name string readonly
traffic number readonly / optional from 0 to 100
modifications [Modification] readonly / optional
widgets [Widget] readonly / optional
redirections [Redirection] readonly / optional
masterVariationId number readonly / optional

Modification

Parameter Value Type Properties Comment
id number readonly
type string readonly
selector string readonly
oldValue string / null
value string / null

Widget

Parameter Value Type Properties Comment
id string readonly
version string readonly
config string readonly
name string readonly

Redirection

Parameter Value Type Properties Comment
target string readonly
isRegex number readonly 0 or 1
pattern string readonly / optional
transferParameters number readonly 0 or 1
ATInternetReferrer number readonly 0 or 1

Type Audience

Parameter Value Type Properties Comment
id string readonly / optional
created_at string readonly / optional
name string
description string
hidden boolean
audience_origin_id string / null
targeting_groups [TargetingGroup]
updated_at string optional
updated_by number optional

Type CampaignType

export const enum CampaignTypes {
  ab = 'ab',
  multipage = 'multipage',
  multivariate = 'multivariate',
  mastersegment = 'mastersegment',
  subsegment = 'subsegment',
}

Type string.

Can be one of possible value from enum CampaignType

For example: ab or multipage or multivariate or mastersegment or subsegment

Type Status

Type string.

Can be one of possible value from enum CampaignStatus

export const enum CampaignStatus {
  accepted = 'accepted',
  pending = 'pending',
  rejected = 'rejected',
  oneVisitorOneTest = 'one_visitor_one_test',
  traffic = 'traffic_rejected',
  checking = 'currently_checking',
  otherSubsegment = 'another_subsegment_already_started',
  targetByEventPending = 'target_by_event_pending',
  acceptedByRedirection = 'accepted_by_redirection',
  targetPages = 'target_pages_rejected',
  qaMode = 'qa_parameters_rejected',
  audience = 'audience_rejected',
}

Type CampaignGlobal

Parameter Value Type Properties Comment
needGeolocFetch [number] readonly
needUAParserFetch [number] readonly
needAdBlockDetection [number] readonly
usedTypes any readonly
needModificationEngine boolean readonly

Property widgets

window.ABTasty.accountData.widgets

Used for this account widget objects

Type: Object

Property crossDomainSettings

window.ABTasty.accountData.crossDomainSettings

Array of cross-domain cookies recreation conditions for account

Property obsoletes

obsoletes

window.ABTasty.accountData.obsoletes

List of obsoletes test ids used for removing stopped tests data from localStorage and cookies.

During compilation we get the list of obsolete(stopped) tests. Obsolete test is the one which has been paused between 15 days ago and 125 days ago.

Type: [integer]