Appearance
Linking to, embedding and building on My Rewards
Three questions come up when a brand wants to put Rewards somewhere other than the standard panel. Can I send a player straight to a tab? Can I put the panel, or one Challenge, inside my own page? Can I build my own screens and still use Rewards?
This page answers each one, and is plain about what is not possible. The first two are mostly for you and your developers together. The third is for developers.
Sending a player to My Rewards with a link
A link can open My Rewards, or open it on a particular tab. It cannot open it on a particular Challenge.
The link format
The link is a fragment added to a page on your site, in the form #rewards.<action> or #rewards.<action>.<value>. Two actions exist.
| Link | What it does |
|---|---|
#rewards.open | Opens My Rewards on its default tab |
#rewards.menu.<slug> | Opens My Rewards on the menu item whose Slug matches |
For example, a button on your promotions page can point at #rewards.menu.welcome. The slug in the link is URL-decoded before it is matched.
What has to be in place
Three things, and a link does nothing quietly if any one is missing.
- The deep linking setting is on. It sits under Experience Settings in Branding Studio, for the origin and communication profile you are editing. With it off,
#rewards...links are ignored. - The menu item has a Slug. Set it in the Slug field of the menu item. See The menu and custom pages.
#rewards.openneeds no slug, but#rewards.menu.<slug>does. - My Rewards is enabled for the player's origin and communication profile. If it is not, the panel does not open.
The link works in two situations: when the page loads with the fragment already in the address, and when a player clicks a link to the fragment while already on the page. Once a link has been followed, Rewards removes the fragment from the address. That is what lets the same button be clicked again later in the session. It also means the fragment is not left in the address bar for a player to copy or bookmark.
A link to a tab that has no slug goes nowhere useful
The slug is the whole mechanism. A tab with no slug cannot be linked to. If you want to link to a tab from a campaign message, a banner or a button, set its slug first. What happens when the slug in a link matches no tab has not been verified, so test each link before it goes out.
What you cannot link to
There is no link to a single Challenge, bonus or reward. The challengeId of a Challenge is not part of the link format, and no action for it exists. This matches Telling players about a reward, which says the same about messages.
There are two ways to get close.
- Give the Challenge its own tab. Build a Custom Page with a Challenges section filtered by a Label that only that Challenge carries, point a menu item at the page, give the item a slug and link to it. The player lands on a tab that shows that Challenge.
- Start it for them. If the aim is that the player is in the Challenge without having to find it, switch on Auto-Claim Challenge on the bonus that carries it. See Starting a Challenge without the player opening My Rewards.
Opening My Rewards from your own code
A link is the simple route. Your developers can also open the panel by dispatching a browser event called show-my-rewards on window. The event can carry these details.
| Detail | What it does |
|---|---|
menuSlug | Opens the menu item with this slug. Takes precedence over navigateToTab |
navigateToTab | Opens the menu item with this content type, for example shop or calendar |
instanceId | Opens the tournament page for this tournament instance |
The #rewards.open and #rewards.menu.<slug> links are turned into this same event, so the same requirements apply, apart from the deep linking setting, which only the links depend on.
Putting Rewards inside your own page
The standard way to show Rewards is the My Rewards panel, which opens over your page. Two ways to place it inside your page instead exist, both as web components that your developers add to the page.
The full panel, inline
<ft-rewards-embedded> is the whole My Rewards panel placed in your page and always open. It has the same header, tabs and content as the overlay, with no close button, no backdrop and no Escape-to-close.
| Attribute | What it does |
|---|---|
menu-slug | Opens on the menu item with this slug. Takes precedence over tab |
tab | Opens on the menu item with this content type, for example shop |
Three things to know before building on it.
- It fills its container. The panel takes the height of the element around it and does not set a height of its own. Put it in a container with a height, or it will not have room.
- Links do not drive it. The
#rewards...links described above are for the overlay. The inline panel skips them, and picks its tab from its own attributes. - It needs Rewards to be running on the page. The panel waits for the player to be signed in and for Rewards to start up. It shows a loading state while it waits, nothing if My Rewards is disabled for the player, and an error message if start-up fails. That message is Something went wrong!, in your brand's own wording for that string, never a technical error. Once the player logs out it shows nothing, and the same goes for a sign-in token Fast Track rejects, such as an expired one. For a player Fast Track does not know yet, just after sign-up, it keeps loading for up to three minutes while it waits for them.
It takes the same branding as the overlay. Its corners are square when embedded, and no Branding Studio setting rounds them; your developers can do that from your own stylesheet. See Branding and appearance.
The player's active Challenges only
<ft-rewards-challenges> shows a list of the player's active Challenges. It takes no attributes, so it cannot be pointed at one Challenge, and it has no filter. It shows the Challenges Rewards loads when it starts up for the player, so it needs Rewards running on the page. When the player has no active Challenges it shows nothing at all and takes up no space, unless your developers give it an empty message of their own.
Whether it also shows Challenges the player has been offered but has not started has not been verified. Do not rely on it as the place a player starts a Challenge.
Iframes
Rewards does not offer an iframe embed for the My Rewards page, or for a single Challenge, and there is no documentation for one. The components above are the supported way to put Rewards in your page. The only iframe Rewards itself uses is the full-screen overlay of the game launcher component, which opens a game Fast Track hosts.
If you need Rewards on a page that is not yours to add components to, raise it with your integration manager or partner manager at Fast Track rather than building around an iframe.
Starting a Challenge without the player opening My Rewards
There is no separate sign-up step for a Challenge. A Challenge reaches a player as a bonus of the Challenge type, and claiming the bonus starts the Challenge. That is the same claim described in Claiming a bonus. It follows that a player can only start a Challenge that has already been given to them.
The starting point is always the same: the bonus has to be credited to the player first. A Credit Reward action on an Activity does this. See The Credit Reward action. Nothing in the player's browser can hand a Challenge to a player who has not been given it.
From there you have two choices.
Let Rewards start it: Auto-Claim
Switch on Auto-Claim Challenge under Automation Settings on the Challenge bonus. When the bonus is credited, Rewards claims it, the Challenge starts, and the player does nothing. They never need to open My Rewards or follow a link.
This is the option to use when you want a Challenge, such as a welcome offer, to be running from the moment the player qualifies. Two limits from Claiming a bonus still apply.
- A failed automatic claim can leave the bonus unclaimed, ready for a manual claim.
- If your brand allows only one active Challenge of a type, and the player already has one, the new bonus is not auto-claimed. It waits as an unclaimed card.
Auto-claim does not ask the player
A player who is auto-claimed has not chosen to join. If the offer needs a decision, with terms they should accept, leave auto-claim off and let the player claim it.
Let the player claim it, from your own screens
If you build your own interface, your developers claim the bonus on the player's behalf when they press your button. This is the same claim the My Rewards card makes.
| What you need | Rewards API call | Notes |
|---|---|---|
| The player's bonuses, to find the Challenge bonus and its user-bonus ID | getUserBonusesV2 | Can be filtered by status. With no filter it returns all of them |
| To claim a bonus, which starts the Challenge | consumeBonusV2(userBonusId) | Takes the user-bonus ID. Refused in the cases listed under When a claim is refused |
| The player's Challenges and their progress, once started | GetUserChallenges | Can be filtered to active, completed or expired |
| To let a player cancel a started Challenge | challengeOptOut(userChallengeId) | Only for Challenges set up with Player Opt-out. Cancelling forfeits the reward |
The calls go to the Rewards GraphQL endpoint on your base URL, at /rewards-graphql-api/query, as the signed-in player. The player components in the browser wrap the same calls as getBonuses(), claimBonus() and getChallenges(). Ask your integration manager or partner manager at Fast Track for the schema if your developers do not have it.
Tournaments are different. A tournament has its own opt-in call, tournamentOptIn, and it is for tournaments only. It does not start a Challenge.
Do not build your own start button on a bonus the player does not hold
The claim takes the ID of a bonus that already belongs to the player. If the Challenge was never credited, there is nothing to claim, and no call can create it from the player's side. Check the Activity that credits it, and the targeting, before looking at your front end.
Where to next
| If you want to | Read |
|---|---|
| Set slugs and build the tabs a link opens | The menu and custom pages |
| Change how an embedded panel looks | Branding and appearance |
| Understand claiming, auto-claim and refused claims | Claiming a bonus |
| Give a Challenge to a player | The Credit Reward action |
| See what your platform must send in | What Rewards needs from your platform |