Question: 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.

We used the following code to capture the User ID:

`function() {
 return hj.property.get('userId');
}`

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.

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.

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:

<https://script.hotjar.com/modules-397099a69f05558cbf66f164cffcaf65.js>

Thanks

Answer: 
Having looked at the JS file loaded by HotJar i discovered the following code

```
hj.hq.isUndefined(hj.globals.get("userId"))

```

From that i extracted the following

```
hj.globals.get("userId")

```

And this works for me as of today. Hope this helps someone else. Please let me know if it has worked in all cases.
It looks like it is not available in DOM right now.

According to Hotjar support:

> 
> ...this change came about when we moved towards supporting Single Page
>  Apps. I'm told that we may provide this ability again in the future,
>  though I don't have an ETA for it at the moment, as we're currently
>  focusing on improving other aspects of Hotjar.
> 
> 
> Checking our current requests for this, it unfortunately seems that
>  not a lot of users are voting on this feature - this is why it's
>  pivotal for us to get this feedback on our "Suggest a Feature" tool
> 
> 
> 

Cheers,
Florian
.