Constructor
new TiqHelper()
- Source:
Requires:
- module:axios
- module:qs
- module:crypto
- module:string-extensions
Requires
- module:axios
- module:qs
- module:crypto
- module:string-extensions
Methods
generateNewVisitorId() → {string}
- Source:
Provides a new GUID
Returns:
A new random GUID
- Type
- string
getTealiumEnvironment(collection) → {string}
- Source:
Provides the UTAG environment based on the {{profile}} of the utag.js URL of the HTML script tag
Example
const rootRequire = require('rpcm-root-require');
const tiqHelper = rootRequire('/platform-helpers/tiq-helper');
// DOM query
var collectionTags = jQuery("script").map((i, el)=> el.src);
// get environment
const env = tiqHelper.getTealiumEnvironment(collectionTags);
// check
console.log(env); // should print the environment
Parameters:
Name | Type | Description |
---|---|---|
collection |
Array | A collection of strings |
Returns:
The current tealium environment or undefined if not found
- Type
- string
getTiqSessionDetails(account, profile, tealUser, tealPass) → {object}
- Source:
Provides an object with one TIQ session details. Keeps session details in-memory throughout the context.
Parameters:
Name | Type | Description |
---|---|---|
account |
string | the CDH profile to use for authentication / token generation |
profile |
string | the CDH profile to use for authentication / token generation |
tealUser |
string | the Tealium user email |
tealPass |
string | the Tealium user pass |
Returns:
{ utk, jsessionId }
- Type
- object
loginUser(email, pass) → {object}
- Source:
Sends a Teal TIQ login request.
Parameters:
Name | Type | Description |
---|---|---|
email |
string | |
pass |
string |
Returns:
An axios network call providing session details if successful
- Type
- object
ping(account, profile, tiqUtk, jSessionId) → {object}
- Source:
Pings Teal TIQ to check session status
Parameters:
Name | Type | Description |
---|---|---|
account |
string | |
profile |
string | |
tiqUtk |
string | |
jSessionId |
string |
Returns:
An axios network call
- Type
- object