/*
###########################################
### TEALIUM COLLECT : DIP DATA STRIPPER ###
###########################################
Author : roshan@tealium.com
Notes:
This extension:
- Should ALWAYS be scoped to the DIP Tealium Collect Pixel
- Will remove any data sources without the relevant reserved prefix (e.g. "dip_")
- You can configure the reserved prefixes below
- There are DIP specific prefixes declared in the 'dip_prefixes' array
- There are Tealium specific prefixes required for Tealium Collect to function correctly in the 'tealium_functional_prefixes' array
*/
// Configuration
var dip_prefixes = ["cp.dip", "dip_"]; // these are DIP specific data sources
var tealium_functional_prefixes = ["cp.trace","cp.utag", "_t_","dom.","ut."]; // these are required for Tealium to function correctly
// ### DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING ###
var reserved_prefixes = dip_prefixes.concat(tealium_functional_prefixes);
for (varName in b) {
var keep_var = false;
for (var i = 0; i < reserved_prefixes.length; i++) {
if (varName.indexOf(reserved_prefixes[i]) === 0) {
var keep_var = true;
}
};
if (keep_var === false){
if(utag.ut.typeOf(b[varName]) === "array"){
b[varName] === b[varName].slice(0);
}
delete b[varName];
}
}