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

Explicit setting of integrations prevents sending of `user_hash`. #10

Open more-ron opened 8 years ago

more-ron commented 8 years ago

We a have a code that dynamically turns on or off Intercom integration depending on the user.

We hit a condition when it should send it to Intercom but it doesn't. It does try to send it but it's missing the user_hash.

        analytics.identify('id', { ... }, {
          Intercom: { user_hash: 'x' },
          integrations: {
            All: true,
            ...,
            Intercom: true
          }
        });

Removing the explicit setting fixed it.

        analytics.identify('id', { ... }, {
          Intercom: { user_hash: 'x' },
          integrations: {
            All: true,
            ...
          }
        });

However that just a work around and it makes the backend code a bit more complicated now that it has to decide to include the Intercom key rather than just setting the value to either true or false.

It's also setting a trap for developers expecting it to just work.

hankim813 commented 8 years ago

Hey @more-ron thanks so much for bringing this up. This is definitely a known issue and is a problem that is rooted at our analytics.js library. Basically, the library does not let you use selective integrations AND integration specific options such as the user_hash.

We've added a note internally to address this issue at the platform level.

armordog commented 8 years ago

This is a big deal for me.

I'm using Intercom's secure mode so I have to send the user_hash. I can explicitly disable Intercom with integrations: { Intercom:false } But sending integrations: { All: true } doesn't turn it back on.

Is there a workaround aside from forcing a browser refresh?

SegmentDestinationsBot commented 4 years ago

Hi @more-ron, as part of the monorepo migration, this issue has been moved to new issue. Our engineers have been notified and will prioritize and work on it ASAP. Thank you!

For more information, see README.md.