Below are directions how to pass data from a Tealium Data Layer into Qualaroo via the Custom Properties API.
Append the following code to your Qualaroo Snippet. The code loops through values inside the utag_data variable on the page and passes them to the Qualaroo Custom Properties API.
Special characters and spaces in keys are converted to underscores. If a value is an array of items it is converted to a string and items are delimited by a comma.
<script>
window._kiq = window._kiq || [];
if (window.utag_data) {
window._kiq.push(['set', Object.keys(window.utag_data).reduce(function(obj, key) {
var newkey = key.toString().replace(/\s+/g, '_').replace(/[^\w]+/g, '_'),
value = window.utag_data[key];
obj[newkey] = (typeof value == 'object' ? value.join(',') : value);
return obj;
}, {})]);
}
</script>
Comments
0 comments
Article is closed for comments.