Speed optimization

Lazy load Intercom on your Webflow site to improve website loading score

Jaroslav Dlask
Jaroslav Dlask
June 8, 2022
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 a good user experience same as for 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.

Better 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

Don't forget 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='https://widget.intercom.io/widget/YOUR_INTERCOM_ID';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 the new articles. Feel free to contact me if you are interested in some topics!