Skip to main content

Hello.

About 6 months ago I tested that when I created a message that used “Company name” variable and user was member of multiple companies, the message was sent to the user once per each company (eg. three times at once, each with different company name).

This is behavior is documented here: https://www.intercom.com/help/en/articles/248-personalizing-messages-using-variables#company-name

Note: If a user is a member of multiple companies, messages using company name will be sent to them once for each company.

 

Also, if I use a filter rule based on some company attribute (eg. Plan) and I use the “Check if user matches” feature in the message dropdown menu, I can see info message:

“In cases where a user is a member of multiple companies, we will evaluate each company individually to see if they match the rules.”

in the “Current matching status” section. It does not tell whether the message will be sent for each message but it shows whether the rules match for each company separately.

However, it seems that now, 6 months later, when I create a message with “Company name” variable, it is sent only once with just one (random?) of the company names and not once for each company that the user is member of.

Is it possible that the behavior changed? I can see in the “Frequency and scheduling” section of message settings that there is NEW besides the setting “Send more than once”. What exactly is new there?

Can you clarify what is the correct behavior?

Thank you.

Hey @Miroslav Šustek Racheal from the support engineer team here👋 

 

It is correct that we will send a message for each matching company, this is still the case. Is this message in a Series? If so, is there a chance your team has enabled company prioritization since you last chatted with us?  

You can read more on this here! The new badge you are seeing is referencing users entering a Series more than once, which you can read more on here


Hi @Racheal .

I am not using series. I am using normal message (chat).

You say:

It is correct that we will send a message for each matching company, this is still the case.

Have you tried it recently?

Here steps that I use to reproduce the issue:

  1. I have user that is assigned to multiple companies (8 to be exact)
  2. I create new message of type “Chat”
  3. The text of the message contains “Company name” variable
  4. Rules are kept on their default setting:
  5. Frequency is also kept on its default settings:
  6. I set the message as Live and load the web page with Intercom (being logged as the aforementioned user).

What happens is that the Messanger shows only one new message for one random company from all the assigned companies (instead of one message for each company).

The same issue happens when I use event as a trigger and even when I use “Send every time the person matches the rules” in “Frequency and scheduling” settings.

Could you try these steps and confirm that in your case it sends 8 (or how many companies your user has) messages and not just one?

Can this be caused because I am working a testing Intercom workspace instead of the production one?

Thank you for your help.


UPDATE: That is strange. The message I created yesterday that only sent me one message (one company) yesterday was sent for all companies today. I did not change anything.

Was it a bug that got fixed? Or is Intercom so unpredictable that it sometimes sends only one message and sometimes all messages (for all companies of single user)?

I tried to duplicate the message (because it is sent only once a day) and it sent all messages immediately.


Anyway, when using an event as a trigger, it still only sends one message.

I can see that browser does a request to https://api-iam.intercom.io/messenger/web/events API endpoint and gets response containing all companies:

but the chat displays just one message (with the first company in the list).


UPDATE 2: And today, I am again getting just one message for only one of the companies when trying to reproduce scenario described in comment #post16949.

@Racheal, you say that it should send one message for each company but in my case it does not behave reliably. Sometimes it sends multiple messages but usually it sends just one message.

Is there anything I can do to make Intercom behave reliably?


Ok, I finally see what causes the different behavior.

We put a list of all companies in window.intercomSettings.companies JavaScript variable in each request when user is logged-in in our application. This causes Intercom to send only one message only for the first one of the companies in the list.

However, if I do not set the window.intercomSettings.companies, Intercom sends all messages (one for each company the user is assigned to).

I find this non-intuitive. Why does Intercom send just one message when window.intercomSettings.companies contain list of all companies and all messages (one for each company) when window.intercomSettings.companies is empty? The JavaScript API documentation https://developers.intercom.com/installing-intercom/web/attributes-objects/#data-attributes does not say anything about this behavior. I thought that the companies array is used to send Intercom data about all the companies the current user is member of. But it seems that it also affects which messages are sent (and it does it in a strange way because it selects only the first company in the list).

 

For the record: When I experienced that Intercom sent all the messages (one for each company) in the first “UPDATE” comment, that was because I logged-out in our application which caused that window.intercomSettings.companies JavaScript variable was not filled. However, Intercom still considered me to be the same user (presumably based on cookies) so it fired all the messages in this very moment.


The “multiple companies” use-case is mentioned on few places on your web:

  • If a user is associated with multiple companies we don't know which company's sessions to update, unless we have a company ID. So in order for the company's sessions to be updated, the user update has to contain the company object.

  • Users can belong to multiple companies, but you should only send us the data for the company that the user is currently signed in with. You can also send other attributes within the company object. Those will be treated like custom attributes for that particular company. You can read more about custom attributes here.

https://www.intercom.com/help/en/articles/186-group-your-users-by-company

However, in this context, only company field is mentioned. And it makes sense that one cannot send multiple companies at once in this field.

 

If you use a company level attribute, for a date attribute based schedule, users may receive multiple copies of a message if they’re a member of multiple companies.

  • If a user is tracked by the Intercom Messenger with an active company_id, only that specific company will be checked for a match.

  • If they’re not tracked with an active company_id, and the message contains company attributes, any of their companies could match the rules for the message, and they will receive a copy for each one.

  • If they’re not tracked with an active company_id, and the message doesn’t contain company attributes, each of their companies will be checked for a match. If any of their companies match the user will receive a single copy of the message.

https://www.intercom.com/help/en/articles/5420235-send-messages-on-a-recurring-schedule

Here, it seems that “active company_id” can be used to select for which of the assigned companies the user should receive the message.

However, I am not sure how to tell Intercom which one is the “active company_id”.

Could you clarify this, please?


I did some more testing and it seems that:

  • when window.intercomSettings.company is sent to Intercom, this company is considered as the aforementioned “active company_id”
  • when window.intercomSettings.companies is sent to Intercom, first company in the list is considered as “active company_id”
  • when both window.intercomSettings.company  and window.intercomSettings.companies are sent to Intercom, it seems to depend on the order in which fields are present in the window.intercomSettings object; the later field in the object has the priority
  • when neither window.intercomSettings.company nor window.intercomSettings.companies are sent to Intercom, then “ruser is] not tracked with an active company_id, and eif] the message contains company attributes, any of their companies could match the rules for the message, and they will receive a copy for each one.

 

I would prefer if I could send all companies in window.intercomSettings.companies without selecting the “active company_id” (so that users would get one message for each company) and only set the “active company_id” by the window.intercomSettings.company field.

In my opinion, the:

when window.intercomSettings.companies is sent to Intercom, first company in the list is considered as “active company_id”

feature is either bug or it should be properly documented here: https://developers.intercom.com/installing-intercom/web/attributes-objects/#data-attributes


FYI: I did some more experiments. What I described in the last comment apparently only applies to chat messages that do not have event as a trigger rule.

When I try the same with message that is triggered by an event, neither order of companies nor contents of company field matter. Intercom always sends only one message for the first company in the list of client_matches that is returned in the response of request to https://api-iam.intercom.io/messenger/web/events endpoint (sent automatically by Intercom JavaScript). And I have no idea what determines the order of the client_matches.

 

This is:

 

Why is the behavior so inconsistent?


Just for the record: I found one more inconsistency. If I create Series that has event as trigger rule and sends message with company name, the message is not sent just for the first company (as is the case for normal message outside of the series) but one message for each company. Despite the fact that I specify “active company” in window.intercomSettings.company field through the JavaScript API (window.intercomSettings.companies is not defined in this case).

 

So there are 3 different behaviors for users with multiple companies and messages that contain some of the company attributes:

  • Chat in Series triggered by event sends multiple messages - one for each company assigned to the user
  • regular message triggered by event sends just one message with only one company assigned to the user (first matched; no way to influence the order)
  • regular message without event in triggers can send either one message with the company based on “active company_id” or more messages with all companies when no “active company_id” is specified

Reply