BuilderIO / partytown

Relocate resource intensive third-party scripts off of the main thread and into a web worker. 🎉
https://partytown.builder.io
MIT License
13k stars 431 forks source link

Zendesk integration #24

Open wadehammes opened 2 years ago

wadehammes commented 2 years ago

Would love to see official Zendesk support/integration post-beta. It is one of our heaviest hitters in main-thread work as far as third-party scripts are concerned and I love the concept of using web workers for this.

stefanbayjensen commented 2 years ago

@wadehammes we managed to "solve" this on our site, by simply creating a custom button – looking exactly like the zendesk one – and when this is then clicked, we start loading the Zendesk scripts.

When the script is loaded, we then set a sessionStorage so we on each page-load know exactly whether the user has interacted with the button or not - as the script should then be loaded, when the page is.

Zendesk also have good SDKs, so you after load can check if the user has an unread message, to then automatically trigger the widget to open (Just like Zendesk normally would).

All of this is of course only possible, if you don't use the automatic message popup before the widget is interacted with 😊

adamdbradley commented 2 years ago

Any assistance recreating the issues Zendesk would have would be appreciated. You could replicate any issues by submitting a PR similar to the structure of another service, such as https://github.com/BuilderIO/partytown/tree/main/tests/integrations/gtm

StuckInSprings commented 1 year ago

This would be amazing. I've found partyown easy to set up for most 3rd party scripts. But Zendesk has trouble with it out of the box. Besides some specific "hacky" solutions I haven't found anything to resolve this.