Making a notification button do something on your site

Sometimes you want a notification button to do something on your website — like open the live-chat window — instead of just sending the player to another page.
You can do this with a special button link that starts with ft-action:.
Why this changed. Buttons used to be able to run code directly through the link (a javascript: link). We had to switch that off because it was a security risk. The ft-action: link does the same job safely.

What it does

  1. The player taps the button.
  2. Instead of taking you to another page, the button quietly tells your website that "the player wants to do X" (for example, "open live chat").
  3. Your website hears that and does it.
The button text is just a label the player reads. Nothing risky happens.

What you set up in the CRM

On the notification's button, fill in two fields:
FieldWhat to put
Button text
What the player sees, e.g. Chat with us
Button link
ft-action: followed by a short name for the action, e.g. ft-action:open-live-chat
Rules for the name after ft-action::
  1. lowercase letters, numbers and hyphens only
  2. no spaces
  3. keep it short
For "open live chat", use exactly: ft-action:open-live-chat
That's everything on the CRM side.

What the partner needs to do (once)

The partner's website needs to be told what to do when the button is tapped. This is a small, one-time setup for their web developers — after that, every notification using ft-action:open-live-chat will open their live chat.
You can forward the box below to the partner's developers as-is.
For the partner's developers
When a player taps a notification button set to ft-action:open-live-chat, our widget fires a browser event called ft-crm:action. Add a listener for it and call your live-chat open function:
If our widget runs inside an iframe on your site, listen for a message event instead and check e.data.type === 'ft-crm:action' and e.data.action === 'open-live-chat'.
The event also carries source (always onsite-notification) and messageId (the notification that was tapped), in case you want to log it.

Common questions

Does the button open a new page? No. It stays on the same page and triggers the action.
Can we use it for things other than live chat? Yes. Pick a different name (e.g. ft-action:open-deposit) and the developer handles that name on their side the same way.
The button isn't doing anything — what's wrong? Usually the link isn't in the exact format. It must be lowercase with hyphens and no spaces, e.g. ft-action:open-live-chat. Also make sure the partner's developers have added the one-time setup above, and that the player is logged in when the notification shows.
We used to use a javascript: link. What do we do now? Switch the button link to ft-action:open-live-chat and have the developers add the setup above. The player sees and experiences the same thing.