0
votes

I have set up our Google Tag Manager (GTM) account so it sends virtual page views to Google Analytics (GA). This boiles down to pushing a custom event on the dataLayer (= GTM) array which will then trigger sending a pageview to GA. This works fine.

The same GTM account also has Hotjar connected to it, and I'm searching to send the virtual page view also to Hotjar. However, I can't seem to find any documentation about this. Hotjar does support it, but they only talk about doing it via their own "hj" function, and I'd rather do it via GTM.

1

1 Answers

1
votes

Based on their official documentation they saying that Hotjar will track page views automatically if you changing URLs in your single page application.

If you SPA changing only fragments, then you need to use this setting "Track changes automatically, including fragments"

If you want to send analogue of "virtual page view" to Hotjar, then you should execute in your GTM:

hj('stateChange', 'some/relative/path');

You should be able to use hj and function should be already defined when GTM is triggering tag.

If you want detailed answer specific to your website, it will be better to share the link to website and the way how you currently configured GTM to track virtual page views