Learn business growth with Google Analytics 4 › Forums › Google Analytics 4 › Troubleshooting issues with GTM Data Layer Variable Version 1 › Reply To: Troubleshooting issues with GTM Data Layer Variable Version 1
-
In Google Tag Manager, it is technically possible to mix and match version 1 and version 2 data layer variables within the same container. However, the behavior of these variables can be different, which might lead to unexpected results.
The issue you are experiencing with ‘phoneNumber’ not being removed after pushing and then removing it, might be due to how each version handles data. Version 1 data layer variables persist data across different events, which means once a data layer variable (like ‘phoneNumber’) is set, it remains available for the remainder of the session or until it’s manually cleared.
So, while you can use both Version 1 and 2 data layer variables in the same container, it’s important to understand the reasons behind their different behaviors, especially when it comes to pushing and persisting data. Considering both versions’ characteristics, it might be simpler to stick to one version to avoid such complications. If you choose that option, changing ‘phoneNumber’ to version 2 should solve your issue.