The PartnerPay system allows you to tag your users with a partner. When those users then trigger a PartnerPay action, the system will keep track of it and credit the right partner. This section describes how to set up actions and trigger them.
All partners have a partner identifer that you need to put in your code to tag a user with that partner.
There are two ways you can tag a user, either by passing this identifer when connecting to Player.IO, or by calling the PartnerPay.SetTag() method on a connected user.
When passing the identifer on connect, the user will only be tagged with that partner if it is the first time he connects. If a user first joined the game through a version having no partner, or a version belonging to another partner, the user will continue being untagged or belonging to the first partner.
This means that you don't need to perform any checks, you can safely pass in the partner identifer in each version of the game and be sure that users stay tagged to the partner where they started:
The other way of tagging a user is through the SetTag() method in the Player.IO API. This method will tag a user with the given partner regardless of who the user currently belongs to.
By default, this method can only be called from server-side code, but it is possible to change the rights for a connection so that it can be performed from client-side code as well.
This means that if an partner wants to be credited for all users playing through the partner's version of the game, it is possible to do so.
All the various connect methods will return the user's actual partner identifier, and it will be stored in the Client and Player objects in the client-side and server-side API respectively.
Using this, you can get even more control over the tagging, for example by allowing a partner to tag all untagged users that play their version: