Answered

How do I send a message using a company attribute when the user is in that company's part of the website (e.g. workspace)?

  • 23 March 2022
  • 6 replies
  • 57 views

Hi there,

 

Our users can be a part of multiple companies. When using our app, they can switch between company workspaces (much like with Intercom, and many other services).

 

Every company has an attribute "isTrialing".

 

I'd like to send a banner to a customer when they are in the company workspace that is currently trialing.

 

I can create rules to "send banner to user when company is trialing", but this is then sent to the user no matter which company workspace they are in. This banner should only be sent to the user when they are in the workspace of the company that is currently trialing.

 

Would appreciate any advice. Thanks!

icon

Best answer by Eric Fitz 23 March 2022, 18:39

View original

6 replies

Userlevel 1

Hey @luke w​, do your workspace URLs have a common structure with certain variables? What would a typical workspace URL look like?

Yes! The workspace/company ID is in the url. For example: https://console.managexr.com/o/oT6wRarigvc4fLxdYjuK/dashboard where "oT6wRarigvc4fLxdYjuK" is the company id.

 

I was thinking I may be able to do some kind of dynamic filter based on the URL and the user's company ID, but couldn't figure that out. Keen to hear your response!

Userlevel 1

You're on the right track! In that case, you could combine URL rules like Current Page URL contains dashboard AND Current Page URL contains console.managexr.com.

Well, in this case the companyId is the only thing that changes between workspaces. For example, a user can access two dashboards https://console.managexr.com/o/COMPANY_1/dashboard & https://console.managexr.com/o/COMPANY_2/dashboard. COMPANY_1 is trialing and COMPANY_2 is not. I only want to show the banner when the user is in COMPANY_1's workspace, but I have no way to differentiate the two right now.

 

Note: in Intercom the user is part of COMPANY_1 and COMPANY_2. The custom isTrailing attribute is true for COMPANY_1 and false for COMPANY_2.

Userlevel 1

In that case, I'd combine the URL filters with the audience rule isTrialing is true.

Badge

Hello, I am also trying to achieve something like this. Can you be more specific on how to set the rules?

In the example that Luke described, how can I set the URL filter so that the message is sent only when the user is on the specific dashboard for COMPANY_1 and not COMPANY_2.

If I set “Current Page URL contains dashboard AND Current Page URL contains console.managexr.com” and “isTrialing is true” rule, isn’t the message going to be sent even if the user that is part of COMPANY_1 and COMPANY_2 visits dashboard of COMPANY_2 that has “isTrailing = false”?

How would Intercom know whether the user is currently on the profile that has the attribute “true” and not the other one?

If I understand it correctly, URL filter is based on the current page but attribute filters are based on the attribute values of user or its companies and those are the same on all pages. Intercom has no idea what company dashboard the user is currently on. It has no way to know that “oT6wRarigvc4fLxdYjuK” in URL is ID of COMPANY_1 and “xxxyyyzzz” is ID of COMPANY_2. Am I right or am I missing something?

 

The only solution for this situation that comes into my mind is sending “visited_dashboard” event with “isTrialing” value of the currently visited company as metadata every time user visits the dashboard and using “Event rule” with condition that “isTrialing = true” as the trigger (as shown here https://www.intercom.com/help/en/articles/5180516-send-repeatable-messages-based-on-events-you-track-in-intercom#h_445b8d90ae ).

Reply