More options for customizing link actions

#1

Currently when creating an URL action theres no way to customize the behaviour of the link.

action: {
  "type": "url",
  "url":  "https://www.example.com"
}

It would be great to:

  1. be able to specify whether link should open in new window or same window. at moment it just defaults to new window.
  2. at moment no referrer is sent to the new page. would be great to be able to customize whether or not this is sent. The use case for this is a customer who has a subdomain for each of their users, we provide them with a single link for each of their tours but currently can’t redirect to the correct subdomain depending on that specific user’s current url.
0 Likes

#2

hey @jonas - you can use the “sheet” action to render a new page within the same messenger window. See https://developers.intercom.com/building-apps/docs/sheets-flow. Not what you want but at least it doesn’t open a new tab.

On 2, have you considered passing a query param to identify the source. Agree referrer will be useful.

0 Likes

#3

Hey @jonas :wave:

I’d say the Sheets flow is the way to achieve the first example, as @krishna mentioned. The reason that we won’t open external links in the same tab/window is because apps in the Messenger are intended to enable workflows directly in that page, or from within the Messenger, not overwrite current sessions.

Query params are also what you should use for that second flow - nice feature request in sending a POST request to external URLs with the context object however :+1:

0 Likes

#4

Hey @zach

For the second scenario, unfortunately a query param won’t work.
The customer wants to configure my app (which renders a link) to show in an auto message to all their users. Since each user has a different subdomain I can’t configure a query param ahead of time as it will differ for each user.

Don’t see how a post request helps as well as you can only redirect from a GET request.

Would be nice to have referrer header when user clicks on a link rendered by a messenger app, but it doesn’t get populated is this intentional?

0 Likes

#5

By referrer, would you expect it in UTM parameters format or something more custom?

0 Likes

#6

Browsers automatically pass referrer as a http header when you click on a link. Unless you explicitly disable it

0 Likes

#7

Thanks for the context Jonas - the workaround here would be to use Sheets instead then and grab the referrer from the context object sent with the open-sheets request, as we pass this through there :+1:

0 Likes

#8

Hi Zach, thanks for the reply. Maybe I’m missing something but don’t see how this is a workaround?
The content we are displaying needs to be full page as its actually another page on the customer’s app, its not our own UI that we are trying to display. Hence why its not suitable to be rendered in a sheet

0 Likes

#9

Ah looks like I actually missed something in your use case - it’s going to be a feature request to get the referrer then for the time being! Cheers for flagging :slightly_smiling_face:

0 Likes