Delayed loading intercom

#1

Hi everyone, is it possible to load the intercom after 5 sec from loading the page?

0 Likes

#2

Hey there! :wave:

Are you just looking to delay the Messenger launcher or some sort of Auto Message on the page?

The only way to delay the launcher at the moment would be to create custom code on your end and use some sort of timer function to load the Messenger on a delay.

If you’re looking to delay a message that’s on the page, you can do that straight in the UI! Let me know if that’s what you’re looking to do here :+1:

-Russell

0 Likes

#3

Hey thank you for your response.

I am trying to load the intercom script with a delay of 5 sec.

Yes, I know I have to create a custom code, I try to use a function setTimeout but then the intercom does not start

 setTimeout(function(){
function inter(){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/my_id';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);};if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}
					console.log("test")
					};

inter();
}, 5000);

Test consol log appears after 5s, but not intercom. Any ideas?

0 Likes

#4

It might be a little easier to instead set your messenger to hidden in your app settings and then use something like this:

setTimeout(function(){
  Intercom('update', {hide_default_launcher: false})
}, 5000);

Do you think that could work?

0 Likes