A Custom Choice message allows you to offer ad blocking users the choice to either allow ads on your site, or to choose a custom option that you implement.
For example, you can offer ad blocking users the option to allow ads on your site or buy a subscription to your site.
Follow the steps below to implement a Custom Choice message:
Step 1: Implement googlefc.controlledMessagingFunction
of the Funding Choices API
You must implement the googlefc.controlledMessagingFunction
function of the Funding Choices unified API before publishing your custom choice message. This is required, and helps ensure that users who have complied with the terms of the custom choice do not see the message on future visits.
<head> <script> // Make sure that the googlefc property exists on the window. window.googlefc = window.googlefc || {}; // To guarantee functionality, this must go before the FC tag on // the page. googlefc.controlledMessagingFunction = (message) => { // Do not show the message if the user is a subscriber. if (user.getStatus() == `subscriber`) { message.proceed(false); } else { message.proceed(true); } }; </script> <FC tag goes here> </head>
Step 2: Set up the Custom Choice message
- When creating a message for ad block users, select the "Whitelist or custom solution" option as the message your users will see.
- Set up the following items when editing the message:
- (Optional) Edit the button text for your custom choice, if necessary
Default Custom Choice button text. Edit if necessary. - In the Custom URL field, enter the URL to which the button should link. For example, you might enter the URL of your subscription sign-up page:
A Custom Choice URL—for example, your site's subscription sign-up page - (Optional) Edit the "Already a subscriber" footer text, if necessary. This footer link is used for users who believe they have already complied with the custom choice.
Default text in Custom Choice footer. Edit if necessary - In the Footer URL field, enter a URL for the footer. For example, the URL might take users to a page that verifies that they are already a subscriber to your site:
A Custom Choice footer URL—for example, your site's subscription confirmation page
- (Optional) Edit the button text for your custom choice, if necessary