Policies: what your users are offered
An access key profile's policies decide, country by country, how its users may connect: free, free for a rewarded ad, a premium trial, premium for a rewarded ad, bought or with a code, and how long each lasts.
Where to set them
Under Access Keys, open Access Key Profiles, then a profile, and edit its Policies. Every access key of the profile follows them.
The policies are a list in JSON: one policy for some countries, and one for "*", every other country. A user's country, by their IP address, picks one. With no policies, free locations connect with no time limit.
In Brazil and Mexico, a free connection lasts 30 minutes, or 2 hours for a rewarded ad. Everywhere else, it lasts 30 minutes, a rewarded ad gives an hour of premium, and premium is for sale.
[
{
"clientCountries": [ "BR", "MX" ],
"normal": 30,
"normalByRewardedAd": 120
},
{
"clientCountries": [ "*" ],
"normal": 30,
"premiumByRewardedAd": 60,
"premiumByPurchase": true
}
]Your servers apply a change at a user's next connection. The app shows the new choices once it has connected, if the farm's Push token to clients is on: that is how the key it holds is updated.
What a user is offered
Three things decide which choices a user gets at a location:
- Their country picks the policy, which says what is offered and for how long.
- The location: the free choices show only where there are free servers, and a trial or premium for an ad only where there are premium ones, those tagged
#premium. - The app: a choice with a rewarded ad shows only in an app that shows rewarded ads, and buying premium only in an app that sells it.
When a location offers a trial or a rewarded ad, the app asks the user which way to connect. Otherwise it connects at once with the free connection.
A key whose profile's Availability is Private is premium: its user connects at once, with no choice to make. Whether a connection shows an ordinary ad is the profile's Ad Requirement, not a policy.
The settings
A policy's minutes are how long a connection lasts: a number of minutes, 0 for no time limit but the key's own end, or null, or no value at all, to offer no such connection.
| Setting | What it does |
|---|---|
clientCountries | The two-letter codes of the countries the policy is for, as ["BR", "MX"], or ["*"] for every country no other policy names.
|
normal | The minutes of a free connection. With null, the country's users get no free connection and connect only in the other ways.
|
normalBy | The minutes on the free servers that a rewarded ad gives a connection. Each ad during it adds as much again, and the connection stays free. |
premiumByTrial | The minutes of a premium trial. |
premiumByTrial | The most trial a user gets a day, as "01:00:00"; null for no daily limit.
|
premiumBy | The minutes of premium a rewarded ad gives. A rewarded ad during a plain free connection gives the same premium. |
premiumBy | Whether the app offers premium for sale. |
purchaseUrl | Your own shop's address. It replaces the app's in-app store; an app installed from a store ignores it. |
premiumByCode | Whether users may type a premium code. |
freeLocations | The countries of the locations that free connections may use, as ["US", "CA"]; null for all of them.
|
autoLocation | Whether users must let the servers pick the location. A connection to a location the user picked is refused. |
unblockable | Whether the app lists only the locations whose servers are tagged #unblockable.
|
Rewarded ads: always the user's choice
Ad networks set rules for rewarded ads. Google's AdMob shows one only to a user who chose to watch it, knowing what it gives, and saying no must leave the app usable (AdMob's policies for ad units that offer rewards). So keep normal set wherever you offer a rewarded ad: without it, the ad would be the only way to connect.
Two setups work well:
- A short free connection, then premium for an ad:
normalandpremiumByRewardedAd. A rewarded ad during the free connection buys premium. - A choice at Connect:
normalandnormalByRewardedAd. The app asks whether to connect free for a short while, or for longer for an ad.