View timeParting.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var timeParting = { | |
/** | |
* @description returns utc offset based on local time (eg//utc-05 = central daylight time, north america) | |
* a list of utc offsets and timezones can be found here: http://forbrains.co.uk/international_tools/earth_timezones | |
* @param pv_date {date} | |
*/ | |
getTimezoneOffset: function (pv_date) { | |
var offset = ((pv_date.getTimezoneOffset() / 60) * -1); //multiply by -1 to account for inverted utc offset in JS getTimezoneOffset() | |
var posOrNeg = (offset > 0) ? "+" : "-"; | |
var tmpOffset = offset + ""; |
View getParams.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* returns an object with all query parameters as key/value pairs | |
* @param payload - if ommitted, returns all params as an object; if passed as string specifying a parameter, | |
* returns the value of the specified parameter name; can be passed as object { search: document.location.search, returnKey: {{parameter-name}} } | |
* @returns {object} - example: http://example.com?a=a-value&B=B-VALUE = > { "a": "a-value", "b": "B-VALUE"} | |
*/ | |
function getParams(payload) { | |
var searchString = document.location.search, | |
returnKey = ""; |
View ensightenPrivacyGateway_blockedResources.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (typeof (gateway) != "undefined") { | |
/** | |
* consoles out the provided array using the provided status as a header | |
* @param status {string} | |
* @param output {array} | |
*/ | |
function gwLogger(status, output) { | |
if (output.length > 0) { | |
console.log(status + " REQUESTS:"); | |
console.table(output); |
View getHotJarUserID.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
// gets hotjar user id (hjUID) | |
var hjUID = ""; | |
try { | |
if (typeof (hj) != "undefined" && hj.hasOwnProperty("globals")) { | |
// sample: a21c0a02-3b48-53c6-94b4-5604e281e5d8 | |
// the value before the first "-" ("a21c0a02") is the user identifier that can be referenced in the hj interface | |
// use the following snippet to return only the user identifier (eg// "a21c0a02"): | |
// hjUID =hj.globals.get("userId").split("-").shift(); |
View ens_getDataDef.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* checks for specified data definition, ensuring only an expected value is returned. | |
* the primary benefit is that "data does not exist" messages are not captured in your data | |
* @param dataDefId {number} data definition id | |
*/ | |
function getDataDef(dataDefId) { | |
// check the list of data definition ids on the current page before attempting to resolve | |
if (Bootstrapper.dataDefinitionIds.indexOf(dataDefId) > -1) { | |
return Bootstrapper.data.resolve(dataDefId); | |
} else { |
View ensighten_overwriteDataElementExtractLogic.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* overwrite ensighten data element extraction logic, forcing the provided | |
* value to be returned the next time Bootstrapper.data.resolve("{{ID}}"); is | |
* called. this essentially changes the extraction logic to: return(value); | |
* @param dataId {string} ensighten data element id | |
* @param value {string} new value | |
* @example setDataElementValue("12345", "winner!"); => "winner!" | |
*/ | |
function setDataElementValue(dataId, value) { | |
if (dataId) { |
View buildCIDfromUTM.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* builds a single campaign identifier (CID) string out of a collection of utm_ parameters | |
* payload is required, but all properties of payload are optional | |
*/ | |
function buildCIDfromUTM(payload) { | |
var delimiter = payload.delimiter || '_'; | |
var cid = payload.cid || [ | |
payload.medium, | |
payload.source, | |
payload.campaign, |
View wistia_milestone_tracking.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.videos = {}; | |
wistiaEmbeds.forEach(function (vid) { | |
window.videos[vid.hashedId()] = { | |
id: vid.hashedId(), | |
name: vid.name(), | |
duration: vid.duration(), | |
status: { | |
step_play: false, | |
step_25: false, | |
step_50: false, |
OlderNewer