Q: Angular 12, GTM dataLayer.push fails(TypeError: Converting circular structure to JSON) We have an application in Angular 6 with GTM added and things work fine. When we migrated the same to Angular 12, we have an issue
I am fairly new to GTM and i have ran into a problem here whenever i do dataLayer.push in my code. Below is the error
VM7006:1 Uncaught TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'Object'
    |     property 'blueprint' -> object with constructor 'Array'
    --- index 1 closes the circle
    at JSON.stringify (<anonymous>)
    at <anonymous>:1:6

So basically what i observe is that there is a script which gets called every time i do a dataLayer.push. This is a 3rd party code(zaraz) which loops through the dataLayer and tries to do a stringify. This is where it fails.
it fails because angular adds __ngcontenxt__ field to the DOM and in the events like gtm.click the gtm.element has the ngcontext field(itself, its children, parent etc.)

The current solution i have is to remove __ngcontext__ recursively in the dataLayer.
Any suggestions?
