Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reduce the impact of third-party code (zendesk)

enter image description here

<script
  id="ze-snippet"
  src="https://static.zdassets.com/ekr/snippet.js?key=some_zendesk_key"
/>

I'm trying to optimize my web site performance. I've faced a big impact of third-party code to my performance, I think all my bundle has a lower size than zendesk code. How can I load it without impacting on the main thread? Should I use the async or defer tags? Or which approach is better for this case?

like image 224
Andrey Radkevich Avatar asked Oct 20 '19 08:10

Andrey Radkevich


People also ask

What is third-party code in website?

Third-party code consists of ads, analytics services, and other elements that are served from a domain that is different from the domain of your URL. These resources are often responsible for poor web performance, as they may contain scripts that block your main-thread and prevent other tasks from being performed.


1 Answers

This seems to be an issue that tortures so many people without a clear solution.

What I managed to do it to reduce the block time by adding this configuration.

window.zESettings = {
    webWidget: {
      chat: {
        connectOnPageLoad: false
      }
    }
  };

ref https://developer.zendesk.com/embeddables/docs/widget/settings#connectonpageload

ps I did a performance test to my zendesk helpdesk "domain.zendesk.com" and the results there were even worse

enter image description here

like image 111
itdoesntwork Avatar answered Sep 22 '22 02:09

itdoesntwork