Open martinbianchi opened 2 years ago
@martinbianchi Did you find any solution to that?
@tcetin Nop :( At the time I tried, hotjar was consuming things from the main thread internally (I think it was GA). When I moved to the service worker many of those internal calls started to fail.
@martinbianchi Thank you for your response. I am also trying to make it work but It seems it doesn't work in a web worker since it needs to access cookies and write cookies. I hope partytown team can find a solution for it. I also created a discussion on partytown repository: https://github.com/BuilderIO/partytown/discussions/466
Any updates on this? We're looking to potentially use Hotjar with PartyTown at my company but can't really get started until we know it'll actually work
Following
Bumping this again
@callum-gander I do this as an alternative, simply loading Hotjar after user interaction (avoiding google pagespeed performance hit by Hotjar initiation):
import Hotjar from '@hotjar/browser';
onMount(() => {
// Function to initialize Hotjar after user interaction
const initHotjar = () => {
const siteId = [your hotjar id];
const hotjarVersion = 6;
try {
Hotjar.init(siteId, hotjarVersion);
} catch (error) {
console.error('Failed to initialize Hotjar:', error);
}
// Remove the event listeners after Hotjar has been initialized
window.removeEventListener('click', initHotjar);
window.removeEventListener('scroll', initHotjar);
};
// Add event listeners for the click and scroll events
window.addEventListener('click', initHotjar);
window.addEventListener('scroll', initHotjar);
});
Hi Folks,
Not sure if here is the correct place for this.
I've been trying to implement partytown to load the hotjar script inside a worker thread instead of on the main thread but I couldn't make it work. The installation verification on Hotjar says that everything is correctly but I can't see any metric being logged.
Is it possible to make it work Hotjar with Partytown?
Here are the configs that I tried without success:
Thanks in advance!