Capturing Hotjar User ID in Google Tag Manager & Google Analytics
<p>We have a setup where we capture Hotjar User ID in Google Tag Manager and then pass it as a custom dimension to Google Analytics. It's done to simply merge and cross-reference both data sources.</p>

<p>We used the following code to capture the User ID:</p>

<p><code>function() {
    return hj.property.get('userId');
}</code></p>

<p>2 days back we stopped receiving the data, even though there haven't been any changes to Google Tag Manage, Google Analytics or our Hotjar account.</p>

<p>My suspicion is that there have been a system update on the Hotjar end. I had a chat with their technical support, but they were unable to help me.</p>

<p>Would be great if someone with more experience could have a look at the following file, to see if there is a way to capturing the 'userId' value:</p>

<p><a href="https://script.hotjar.com/modules-397099a69f05558cbf66f164cffcaf65.js" rel="nofollow noreferrer">https://script.hotjar.com/modules-397099a69f05558cbf66f164cffcaf65.js</a></p>

<p>Thanks </p>