Search code examples
google-tag-managergoogle-datalayer

GTM dataLayer restrictions


I am about to send an user's email address via dataLayer.push(), I was wondering if there are any dataLayer restrictions that I should be aware of?

for instance, in Google Analytics, it is not recommended to send email addresses or any PII(Personally identifiable information).

Is it a good idea to send email address, first and last name via dataLayer.push()?

I was not able to get any definitive answers online. Maybe someone can shed a light here. Thanks


Solution

  • Datalayer.push will not do anything with the data except putting it into a variable that is local to the browser. So at this point there is not harm done, and there is not legal or otherwise prohibition to do so (which is what you are asking).

    Of course having it on the dataLayer does not do anything by itself.

    The question is what you are going to do with the data, and that depends on your jurisdiction (in Europe the GDPR applies, other countries have their own privacy laws) and how the TOS for your tracking tools look like (e.g. in GA you cannot have PII, even if the GDPR or comparable laws do not apply in your country).

    But for example if you have consenting users, and storing their email address is essential for delivering the service you are advertising on the page, then pushing this to the dataLayer and using it for your essential purpose should be fine (IANAL).

    Also, once the data is in a variable, every other tracking tool that you have implemented on your page can access the value even without your knowledge (but then they can already read it from input fields or other elements in the page code, so that doesn't add much to the danger).