Multi-domains and member redirection
Is your Spot embedded in several places? Declare, for each member, the embed URLs they should be redirected to.
When your Spot is embedded in several places, for instance in your product and on your website, or in a product with one URL per customer (company1.acme.com, company2.acme.com…), MeltingSpot needs to know which page to send each member to when they click a link: notification email, widget content, short link…
This page explains how to declare these URLs for each member, and how MeltingSpot picks the final URL.
Concepts
Spot base URL and member embed URLs
The Spot base URL is unique. It is set in the
Embedtab of your Spot settings and is the default URL for all members.A member's embed URLs belong to that member only. They are a list of URLs, each identified by a key:
{
"default": "https://company1.acme.com/academy",
"website": "https://www.acme.com/community"
}Keys only exist at member level: there is no list of keys to declare at Spot level. The same key can therefore point to a different URL for each member (for instance default pointing to company1.acme.com for one member, and to company2.acme.com for another).
The default key
default is the only reserved key. It is used:
when no key is requested, which is the case for all notification emails;
when the requested key does not exist for the member.
Custom keys
You are free to name the other keys (company1, website, customContext…). They are case-sensitive: Website and website are two different keys.
A custom key is only used when it is passed through the domain parameter of a widget, the embed or the Coach (see Choosing the key).
URL format
Each URL must be the full https:// URL of the page that hosts the embed of your Spot, not just the domain. It is the same rule as for the Spot base URL: the embed scripts must be installed on that page.
To open the right resource, MeltingSpot adds its path to the ms_url parameter of the URL. The embed script reads this parameter and displays the matching page. Other parameters already in the URL are kept.
Declaring a member's URLs
Two methods are available. They don't behave the same way:
Members
Members who log in via SSO
All members
When
At each SSO login
At any time
Behavior
Merge: add, update or remove key by key
Replace all of the member's URLs
Via the JWT token (SSO)
Add the domains parameter to the user's SSO token (see Generate an SSO token):
set: a{ key: URL }object of URLs to add or replace;unset: an array of keys to remove.
Rules applied at each SSO login, for new and existing members alike:
keys in
setare added, or replaced if they already exist;keys in
unsetare then removed: a key present in bothsetandunsetis therefore removed;keys already stored that are neither in
setnor inunsetare kept;if the
domainsparameter is missing, the member's URLs don't change.
For instance, with the token above:
Via the API
Use the member update endpoint with the embedBaseUrls field:
If the
embedBaseUrlsfield is omitted, the member's URLs don't change.If you send
{}ornull, all of the member's URLs are removed.If the field is not an object whose values are all strings, the API returns a
400error.
To read a member's URLs, use GET https://openapi.meltingspot.io/v1/spotMembers/{spotMemberId}: the response contains the embedBaseUrls field ({} if the member has none).
Choosing the key: the domain parameter
Custom keys are only used when the domain parameter is passed. Otherwise, the default key applies.
Widget script
Clicks on widget content, links shared from the widget
Embed script
Links generated from the embed (share buttons…)
Coach SDK
Links of the contents and widgets displayed by the Coach
Short link generated from one of these sources
The key is stored in the short link
Notification emails
No key: the default key applies
In each of these scripts, add the key to use:
Redirection algorithm
For each link, MeltingSpot computes the member's destination URL as follows:
If embed is deactivated, if the base URL is empty, or if redirection is set to
No redirection: the member is sent tohttps://go.meltingspot.io/spot/{spotId}/….If redirection is set to
SSO users onlyand the member has never logged in via JWT SSO: they are sent tohttps://go.meltingspot.io/spot/{spotId}/….Otherwise, MeltingSpot picks the first available URL, in this order:
the member's URL for the key passed through
domain;the member's URL for the
defaultkey;the Spot base URL.
MeltingSpot adds the resource path to the
ms_urlparameter of the picked URL. If that URL is not valid, the member is sent tohttps://go.meltingspot.io/spot/{spotId}/….
Short links
If short links are activated, emails and Share buttons produce a https://mltngs.pt/s/… link. This link is the same for all members: the destination is computed when the link is clicked, for the logged-in member, using the algorithm above.
A short link generated from a widget, the embed or the Coach configured with a
domainparameter stores this key. It applies to every member who clicks, falling back to theirdefaultkey if they don't have it.Other short links, including those in emails, have no key: the
defaultkey applies.If the member is not logged in, they go through the login page before being redirected.
If short links are deactivated, the link copied from a Share button is the URL of the page you are on: every member who clicks it lands on that same embed.
Full example
Spot configuration: base URL https://www.acme.com/academy, redirection set to All users.
Members' embed URLs:
Alice:
{ "default": "https://company1.acme.com/academy", "website": "https://www.acme.com/community" }Bob:
{ "website": "https://www.acme.com/community" }Chloe: no URL
Redirection to a Live (/lives/<liveId>):
Notification email
https://company1.acme.com/academy?ms_url=%2Flives%2F<liveId>
https://www.acme.com/academy?ms_url=%2Flives%2F<liveId> (Spot base URL)
https://www.acme.com/academy?ms_url=%2Flives%2F<liveId>
Click in a widget with domain: 'website'
https://www.acme.com/community?ms_url=%2Flives%2F<liveId>
https://www.acme.com/community?ms_url=%2Flives%2F<liveId>
https://www.acme.com/academy?ms_url=%2Flives%2F<liveId>
Click in a widget with domain: 'company2' (unknown key)
https://company1.acme.com/academy?ms_url=%2Flives%2F<liveId> (default key)
https://www.acme.com/academy?ms_url=%2Flives%2F<liveId> (Spot base URL)
https://www.acme.com/academy?ms_url=%2Flives%2F<liveId>
With redirection set to No redirection, all three members land on https://go.meltingspot.io/spot/{spotId}/lives/<liveId> in every case.
Good to know
My member lands on go.meltingspot.io although I declared URLs for them. Why? Check that redirection is not set to
No redirection. InSSO users onlymode, check that the member has already logged in via JWT SSO. Finally, check that the picked URL is a valid URL.What happens if the key passed doesn't exist for the member? The member is redirected to their
defaultURL, or to the Spot base URL if they don't have one.What happens for a member I haven't declared any URL for? They are redirected to the Spot base URL (or to
go.meltingspot.ioinSSO users onlymode if they have never logged in via JWT SSO).Can the JWT token remove all of a member's URLs? Yes, by listing all their keys in
unset. To start over from an empty list, you can also send"embedBaseUrls": {}through the API.
Ce contenu vous a-t-il été utile ?