Referral program
A referral program is a method of attracting new users, where existing users invite their friends to the Web Shop via a special link. As a result, all participants of the program receive rewards, which increases their loyalty and motivation to continue interacting with Web Shop.
The referral program allows influencers and clan leaders to promote the Web Shop to their benefit and that of their subscribers. Invitees receive a reward for their first purchase, thus increasing the number of engaged users purchasing from the Web Shop.
The invitee will receive a reward only once when making the first purchase.
The inviting user will receive a reward for each invitee who has made a purchase in the store.
- Providing as rewards one or several items of the following types:
- virtual currency
- virtual item
- bundle with items
- Customization of the referral program widget.
- Generation of referral links.
- Changing the selected referral program for the invitee, before they make their first purchase.
- There can only be one referral program in the project.
- Users cannot invite themselves.
Inviting user flow
- The inviting user goes to Web Shop.
- The inviting user logs in or registers on the site.
- The inviting user opens the referral program widget and reads the program’s conditions.
- The inviting user gets the referral link in the widget.
- The inviting user shares the link with the invitee.
- The invitee follows the link and fulfills the program’s condition.
- The inviting user opens the referral program widget and clicks the button to receive the reward.
Invitee flow
- The invitee receives a referral link with a description of the program’s conditions and rewards.
- The invitee goes to Web Shop via the referral link.
- The invitee registers in the Web Shop.
- The invitee makes the first purchase in the Web Shop.
- The invitee receives the reward.
How to get it
Creating a referral program
- Open your project in Publisher Account.
- Click Store in the side menu.
- In the Live-ops and promotion tools pane, click:
- Connect — if you don’t have promotions or rewards.
- Configure – if you previously connected promotions or rewards.
- On the Referral program tab, click Create referral program.
- Set the necessary parameters:
- Specify the name of the referral program
- Enter the description
- Click Next.
- Add rewards that the inviting users and invitees will receive:
- To add a reward for the inviting user, in the Reward for inviting players section, specify the SKUs of the items and their quantity.
- To add a reward for the invitees, in the Reward for invitees section, specify the SKUs of the items and their quantity.
The inviting user will receive a reward for each invitee who has made a purchase in the store.
Therefore, they should be given a reward that can be repeated.
For example, you can give the invitee the unlocking of a certain character in the game. The inviting users should not be given the unlocking of a character as a reward, though, because they can’t unlock the same character multiple times.
- Click Next.
- Check the description of the referral program and click Create.
- To activate the referral program, set the Referral program toggle to the on position.
After setting up the referral program, you can create and customize the widget.
Widget setup
- On the referral program page, click Go to customizer.
- Set up widget components for a set of states. To make the widget match the design of the game and site, you can customize it and configure the following characteristics:
- a set of interface elements
- colours of interface elements
- button texts and headers considering localization
- font type, color, and size
In the widget settings, you can also customise the content of the frequently asked questions block for the referral program in accordance with the specifics of your game.
- Set up localization. All widget texts are translated into the project languages specified in Publisher Account in Project settings > General settings > Project languages section.
To change the default translations, click on the text twice and enter your own. - Click Publish.
- Copy the widget code in the opened window and add it to your website.
After adding the widget code to the site, the button to open the widget will be displayed on the page:
Adding widget code to your site
If you implement your own site interface, add the widget code into your site’s code. If you are using Xsolla Site Builder to add a referral program widget to your site:- Open your project in Publisher Account.
- Click Site Builder in the side menu.
- In the Sites section, select your site and click Open Site builder.
- Click Add Block.
- Select Custom code block.
- Add the referral program widget code.
Setting up authorization
If you use Xsolla Site Builder to create a Web Shop, no widget modifications are needed, as the functionality of user authorization in the widget is implemented on the Xsolla side.If you use your own site interface, you need to implement functionality for user authorization in the widget on your side.
The authorization in the widget is carried out through the authorization on the site where the widget is embedded.
There are 2 scenarios depending on where the user authorizes — on the site or in the widget:
- If the user authorizes on the site, you need to pass the user’s authorization token to the widget using the onTokenChange() method. When the user logs out of the system, pass
null
as the method parameter.
- If the user authorizes through the widget, the widget will call the requestAuth function passed to it during initialization. In response, the site should return the user’s authorization token.
- js
window.XESApi.init({
requestAuth: requestAuth,
token: getToken()
})
The widget API provides a set of functions and methods for authenticating a user in the widget:
Parameter | Type | Description |
---|---|---|
init | (config: Config) => void | Method used for initializing the widget. |
init()
method is passed the widget configuration:Parameter | Type | Description |
---|---|---|
requestAuth | ()=> Promise | Function that the widget calls when authenticating the user. |
token | string or null | The current user’s authorization token. If the token is unknown at the time of widget initialization, pass a null value. |
Parameter | Type | Description |
---|---|---|
onTokenChange | (token: string/null) => void | Method to pass the current user’s token to the widget. Pass null when the user logs out of the system. |
How to make changes
Making changes to referral program settings
You can make changes to the active referral program:- change the list of items that are provided as rewards
- change descriptions
- Go to created referral program.
- Click Edit.
- Update text or item SKUs.
- Click Save.
After saving the changes, users will see the updated program conditions and receive new rewards.
Rewards that users have already received before the conditions update will not change.
Re-publication of the widget is not required after updating the conditions.
Making changes to the widget settings
You can make changes to the colors, fonts, and components of the widget. To do this:- Go to the widget settings.
- Make the necessary changes.
- Click Publish.
Widget states
The referral program widget can have different states depending on the type of user — inviting or invitee, user’s authorization status, fulfilment of program conditions.
The set of widget components includes interface elements for different states. You can configure components when setting up the widget.
Button to open the widget:
State | Description | Who it’s displayed to | Components that can be edited | Image |
---|---|---|---|---|
View details | Engaging the user to participate in the program. | Authorized users who are not yet participating in the program. | Background and text colours. Text of the widget open button and view details button text. | |
Waiting for authorization | Encouraging the user to log in through the widget. | Unauthorised users who have followed the referral link. | Background and text colours. Button texts. | |
Waiting for the first purchase | Encouraging the user to make the first purchase. | Users who have followed the referral link and logged in to the site. | Background and text colours. Button texts. | |
Receiving a reward | Encouraging the user to receive a reward. | Inviting users whose friends have met the program conditions, and they can receive a reward. | Background and text colours. Button texts. | |
Closing the widget | The widget is open, the button has turned into a × icon. | Authorized users who have opened the widget details. | Background and text colours. Button colour. | |
Default | The widget is closed. | Users who have closed the widget. | Background and text colours. Button text. | |
Widget page for the inviting user:
Description | Who it’s displayed to | Components that can be edited | Image |
---|---|---|---|
| An authorized inviting user, whose friend followed the referral link and logged in to the site. | Background and text colours. Widget text, button texts. | |
Frequently asked questions section | An authorized inviting user who clicked the program information button. | Adding and removing blocks with questions. Background and text colors. Content of questions and answers. | |
Widget page for the invitee:
Description | Who it’s displayed to | Components that can be edited | Image |
---|---|---|---|
The widget text encourages to make a purchase on the site. After making a purchase, the user is shown a notification about receiving a bonus. | Users who have followed the referral link and logged in. | Background and text colors. Widget text, button texts. | |
Found a typo or other text error? Select the text and press Ctrl+Enter.