Creating a Marketing Consent Page on Klevr Portal
A comprehensive guide on how to create a marketing consent page on the Klevr portal.
Description
A comprehensive guide on how to create a marketing consent page on the Klevr portal. Learn how to locate the necessary files, import the Marketing Consent zip file, perform a uSync import, and import permissions.
Introduction
Creating a marketing consent page on Klevr Portal is a straightforward process. This guide will walk you through the process, starting with locating the necessary files, performing a uSync import, and finally importing the Marketing Consent zip file and permissions.
At the end of this process you will have a page that allows an authenticated user to update his consents for all topics and compliance profiles for both their email and mobile phone numbers.
Creating the Page
The files required for creating a marketing consent page can be found under the Klevr CE Teams files, in the klevr portal \ marketing consent path:

Before proceeding with the configuration, it is necessary to perform a uSync report on your Klevr portal. This step ensures there are no discrepancies between your current configuration and the files on disk. It might also be useful to do a usync clean export to be sure the files match your configuration.
Once you have confirmed that your configuration is in order, you can proceed to import the Marketing Consent zip file under the klevr settings area. This file contains the API definitions, the Marketing Consent page and template, and an update to the info document type to use the new template. Once you have uploaded it, go back to the usync area and perform an import of everything. We need to do everything, because there is a new template and changes to the info document type (under settings) and then there's the API definitions and consent page (under content). By clicking import under the everything menu ensures all of these are created in the right order:

The last step is to import the permissions.json file. This file adds permissions for the consents, topics, and purpose tables. Navigate to the table permssions area, and choose a file, browse to the permissions.json file. Click the import button. It should import 3 new permissions for you:

These permissions granst authenticated users access to all topics and purposes, and all consent records that match their email address or mobile phone number.
Conclusion
Following these steps, you should now have a marketing consent page under content -> home on your Klevr portal.
By default it will be shown in the menu, but you can hide it and make a button on the profile page or have it display anywhere else you fancy. The page will verify that the user is logged in, otherwise it will redirect them to the login page. You could also add page restriction to it to ensure it does not show up for unauthenticated users in the menu.
The page uses the new marketing consent template that was created during import. This template uses Vue to display the info on the page. On load it uses asyncronous calls to the new API endpoints to load the topics and consent records for the current user. It displays them in a hierarchial list with checkboxes. As you tick or untick a checkbox, it greys out while it does an asyncronous call to the API to create or update the appropriate consent record. You can opt in or out at a purpose or topic level. The section is repeated for email and mobile phone. You can modify the template to hide or remove the mobile phone area if you wish not to use it. If the user's mobile phone is blank, it will also be hidden.
Last updated on