By default, Gatekeeper provides a minimal set of authorizations: "allow", "deny", and "captcha". However, some websites operators might want a wider range of options, such as asking visitors to create an account or encouraging them to purchase a subscription to your service.
For example, let's say we have a set of sports articles as one part of the content on our site and also suppose that we want to target frequent sports readers to see if they'd be interested in signing up for our premium sports package. This response is more targeted than the general paywall and might yield some sports subscribers that might not otherwise sign up for a general subscription.
In this guide, we'll create a custom authorization to indicate that we should include a sports signup banner at the top of page.
To start, let's create a page group for sports articles. Go to the page groups page and click the "New page group" button. We'll have this page group match all pages that start with "/sports/".
Note the ".+" at the end of the page. This is a regular expression that means "one or more of any character", and allows our single page definition to match /sports/article-1, /sports/article-2, and so on.
Next, create the policy. Go to the policies page and click the "New policy" button. In the Response section, open the authorization select and choose option "New custom authorization".
This should open up a form for creating custom authorizations. The important field is the value, which we'll set to "sports". The display field is purely decorational to make our authorization read smoothly in the policy sentence. Go ahead and save the new authorization.
Now, we can select our custom "sports" authorization in the policy. We'll finish up the policy by setting the policy to trigger when a user visits sports article pages 3 times in 30 days.
And we're done. We can now set up our application to show a banner when it gets back a "sports" response from Gatekeeper.
If you don't want users that have already signed up for a general subscription or a sports subscription to see the upsell banner, you might consider creating a whitelist for these users or you can use the visitor group API to check whether or not the user in question has already signed up for a subscription.