segment-integrations / analytics.js-integration-intercom

The Intercom analytics.js integration.
https://segment.com/docs/integrations/intercom/
MIT License
7 stars 12 forks source link

Make injected script tag asynchronous #7

Closed yanneves closed 8 years ago

yanneves commented 8 years ago

Suggestion based on the script injection Intercom provides directly:

Original:

var s=d.createElement('script');s.type='text/javascript';s.async=true;
s.src='https://widget.intercom.io/widget/{app_id}';

Beautified:

var script = document.createElement('script');
script.type = 'text/javascript';
script.async = true;
script.src = 'https://widget.intercom.io/widget/{app_id}';

See https://docs.intercom.io/install-on-your-web-product/integrating-intercom-in-one-page-app

yanneves commented 8 years ago

Any chance of getting this merged? Still a prominent issue with this integration.