Skip to content

Commit

Permalink
Prevent possible circular reference in preview mode in addDebugValues
Browse files Browse the repository at this point in the history
  • Loading branch information
nova-os committed Jan 18, 2021
1 parent ed41d2b commit a0c83c2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion javascripts/tagmanager.js
Expand Up @@ -1485,7 +1485,13 @@

container.id = this.id;
container.versionName = this.versionName;
container.dataLayer = JSON.parse(JSON.stringify(this.dataLayer.values));
container.dataLayer = JSON.parse(JSON.stringify(this.dataLayer.values, function( key, value) {
if (typeof value === 'object' && value instanceof Node) {
return value.nodeName;
} else {
return value;
};
}));
};

this.getTriggerById = function (idTrigger){
Expand Down

0 comments on commit a0c83c2

Please sign in to comment.