Skip to content
VpnHood!

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.
What decides a user's choices at a location The user's country picks a policy, the location has free servers, premium ones or both, and the app may or may not show rewarded ads and sell premium. Where a trial or a rewarded ad is offered, the app asks: a free server, a free server for an ad, premium for an ad, a premium trial, or premium bought. A private key connects at once. what decides the choices the user's country picks a policy the location free, premium, or both the app rewarded ads? sells premium? a private key connects at once: no choice this location is free, with premium Free Server 30 minutes Free Server by Ad 2 hours or Watch Ad premium, 60 minutes Try Premium premium, 30 minutes Go Premium buy it, or a code The app asks when a trial or a rewarded ad is on offer.
What decides a user's choices at a location The user's country picks a policy, the location has free servers, premium ones or both, and the app may or may not show rewarded ads and sell premium. Where a trial or a rewarded ad is offered, the app asks: a free server, a free server for an ad, premium for an ad, a premium trial, or premium bought. A private key connects at once. what decides the choices the user's country picks a policy the location free, premium, or both the app rewarded ads? sells premium? a private key connects at once: no choice this location is free, with premium Free Server 30 minutes Free Server by Ad 2 hours or Watch Ad premium, 60 minutes Try Premium premium, 30 minutes Go Premium buy it, or a code The app asks when a trial or a rewarded ad is on offer.

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.

SettingWhat it does
clientCountriesThe two-letter codes of the countries the policy is for, as ["BR", "MX"], or ["*"] for every country no other policy names.
normalThe minutes of a free connection. With null, the country's users get no free connection and connect only in the other ways.
normalByRewardedAdThe 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.
premiumByTrialThe minutes of a premium trial.
premiumByTrialDailyLimitThe most trial a user gets a day, as "01:00:00"; null for no daily limit.
premiumByRewardedAdThe minutes of premium a rewarded ad gives. A rewarded ad during a plain free connection gives the same premium.
premiumByPurchaseWhether the app offers premium for sale.
purchaseUrlYour own shop's address. It replaces the app's in-app store; an app installed from a store ignores it.
premiumByCodeWhether users may type a premium code.
freeLocationsThe countries of the locations that free connections may use, as ["US", "CA"]; null for all of them.
autoLocationOnlyWhether users must let the servers pick the location. A connection to a location the user picked is refused.
unblockableOnlyWhether 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: normal and premiumByRewardedAd. A rewarded ad during the free connection buys premium.
  • A choice at Connect: normal and normalByRewardedAd. The app asks whether to connect free for a short while, or for longer for an ad.

Next steps