Custom Widgets: Helpers

Introduction

Each script throughout the platform has access to a handful of functions : Account Javascript, targeting code, campaign Javascript, custom script, …

To call them, you need to use the variable HELPERS within the code editor.

Each custom script throughout the platform is stored within an anonymous function which holds an instance of this HELPERS, so each HELPERS is independent and is relative to your current script location.

Helpers

ABTastyCookie

Call: new HELPERS.ABTastyCookie();

Returns an object containing all the information about AB Tasty cookies in a more human readable way.

ABTastyLocalStorage

ABTastySessionCookie

Details about the AB Tasty session cookie.

Already contained within ABTastyCookie.

campaign

Contains data relative to the campaign from which the HELPERS was called.

Usage of alreadySeenOneTest: HELPERS.campaign.alreadySeenOneTest(new HELPERS.ABTastyCookie())();

forceUntracking and stopTargetingPerf are not usable.

campaignId

Contains the campaign id from which the HELPERS was called.

doWhen

Takes two mandatory arguments.

First one is a function that must return a boolean value.

Second argument is callback function that will be called once the first argument returns true.

First argument is called each 100ms, second argument is executed only once.

getGeoloc

Gives the information about your current geolocation. Data is fetched from the session storage ABTastyGeoloc entry.

getParsedUserAgent

Gives the information about your current user agent. Data is fetched from the session storage ABTastyUA entry.

jsCookie

Embedded package:

Documentation available here: https://github.com/js-cookie/js-cookie

variationId

Contains the variation id from which the HELPERS was called.

Last updated

Was this helpful?