Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_clear property - is it safe to use in production? #98

Open
krzysztof-studnicki-booksy opened this issue Aug 30, 2024 · 1 comment
Open

Comments

@krzysztof-studnicki-booksy

Hi,
we need to use the _clear property that is described here https://github.com/google/data-layer-helper?tab=readme-ov-file#preventing-default-recursive-merge, but we're not sure if it's something that can be used in production.

It solves a problem that we have, but there's no mention about it in GTM docs, so I figured we could ask you there.

@MFRWDesign
Copy link

We are using _clear in production for a year or so and it has been working great. Obvious danger would be an undocumented change that breaks this functionality, but so far so good.

[If that's too scary, the more hacky way that also works is that you can just push two events. First, what I'd call a 'clear' utility event (eg push an 'empty' event with only the variable(s) in question, where all of them are set to a value of undefined - the event name can be anything you pick). Then, simply push your 'real' event with all the good data.]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants