Contact Email Address into Google Tag Manager


I'm looking to bring an MD5 hash of Contact Emails into Google Tag Manager for integration with Google Analytics. This will allow me to later make use of GA's Measurement API to join up HubSpot sales (and other events) with GA data.

Admittedly, I'm really new to this. Based on my research, I believe I will need to set the &uid field as the hashed email address - probably something like {% raw %}{{|md5}}{% endraw %} - but am not sure how this variable (custom javascript?) is going to be set exactly.

Any help would be most appreciated!


Hi @GordonLee,

That's tricky; keep in mind that HubL is processed server-side, so you won't be able to include that token in your GTM script since that's an external script. I'm not entirely sure the best way to get that token to render in such a way that you can access it via your GTM script; you might be able to include a custom JS script in HubSpot that has that token in it, and then pass that somehow to your GTM script?