Guides
"idzCustomData" is deprecated
You want to update your implementation, or you've noticed a warning in your browser console indicating that your iAdvize "Custom Data" implementation is outdated?
Don't worry, simply follow this guide, which will walk you through, step by step, how to adapt your implementation with practical examples.
For Google Tag Manager users
If you see a deprecation message in your console related to Custom Data and you're using Google Tag Manager to deploy iAdvize on your website, you don't need to follow this guide. Simply make sure you're using the latest versions of the iAdvize tags available in the Community Gallery: https://tagmanager.google.com/gallery/#/?filter=iAdvize
Before (old implementation)
You had to create a
idzCustomDataobject within the global window object.When you wanted to add data, you had to make sure to update your existing object rather than overwrite it.
You were required to set your Custom Data BEFORE the main iAdvize tag was loaded, which could be restrictive in some situations or cause race condition issues.
If you wanted to update a custom data value or add a new one AFTER the iAdvize tag had loaded, you were stuck...
Example
<script>
window.idzCustomData = {
product_id: "my_product_id_001"
};
</script>Now (current implementation)
You no longer need to worry about the loading order of your custom data relative to the main tag.
You can safely update or add to your custom data without risking overwriting previously stored information.
Example
<script>
window.iAdvizeInterface = window.iAdvizeInterface || [];
window.iAdvizeInterface.push(function(iAdvize) {
iAdvize.set("customData", {
product_id: "my_produc_id_001"
});
});
</script>If you need to add another Custom Data, you can simply call the method again:
<script>
window.iAdvizeInterface = window.iAdvizeInterface || [];
window.iAdvizeInterface.push(function(iAdvize) {
iAdvize.set("customData", {
product_id: "my_produc_id_002",
page_type: "product_detail"
});
});
</script>You can read the documentation to learn more about Custom Data.
Last updated
Was this helpful?