Speed Optimization

Lazy Load Intercom on Your Webflow Site to Improve Website Loading Score

Jaroslav Dlask
Jaroslav Dlask
February 16, 2023
3 min
Lazy Load Intercom on Your Webflow Site to Improve Website Loading Score

Why Are We Doing This?

Every third-party integration slows your website down. A fast website is important for both a good user experience and rankings in Google search results.

The average user device is worth about $300. A slight speed improvement on your high-end device means a significant boost for low-end devices.

Faster loading speed means an improvement in conversion rate 💰. Lazy loading Intercom can boost your PageSpeed score by 10-15 points. Optimizing Intercom is especially important because it affects every page on your website. Before you begin, test your website here and write down your page speed score.

1) Open Your Project Settings

Project Settings
Project Settings

2) Switch to Custom Code tab

Custom Code tab
Custom Code tab

3) Copy And Paste This Code Before </body> Tag

Make sure to place the code between <script></script> tags.

 var intercomLoader = function() {
  (function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s, x);};if(document.readyState==='complete'){l();}else if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();
  window.Intercom('boot', {
   app_id: 'YOUR_INTERCOM_ID'
  window.removeEventListener('scroll', intercomLoader);
 window.addEventListener('scroll', intercomLoader);

4) Add Your Intercom ID

Replace YOUR_INTERCOM_ID with your Intercom ID. You can find it here. Don't forget to replace both IDs in the code snippet. Hit the ‘Save Changes’ button.

This is how your footer code should look like (app_id will be different)

5) Publish Your Project

All changes will be applied after you publish your site. Now you can open PageSpeed Insights to see the difference in website performance.

I am working on new articles. Feel free to contact me if you are interested in any specific topics!