[intercom] Intercom JS widget loaded prematurely

Open
#314 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
frontend, web-dev

Research direction

Locate the Intercom integration code that loads or initializes the widget, then reproduce the setup described here with the Segment script in the document head and no available document.body. Verify that initialization is deferred until the body exists, and confirm that the widget opens reliably afterward.

Written by the indexing model from the issue text.

Description

Migrated from #32 by @tay

I'm an engineer at a Segment/Intercom client and we were receiving customer reports that the Intercom window wasn't opening from time to time. As background, we include the Segment script in <head> as recommended and have installed the Intercom integration.

As I was able to reproduce the issue sporadically, I tracked it down to the Intercom widget initializing when document.body was not available. With the above installation setup, this does not guarantee that body will be available by the time the Intercom integration loads, as required.

As Intercom advises, one way to solve the problem would be to include the Intercom script tag in <body>, rather than <head> which is what we see this integration doing.

Dominant language
JavaScript
Stars
125
Forks
136
Avg merge
2h 45m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from segmentio/analytics.js-integrations

All issues in segmentio/analytics.js-integrations

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.