Capturing consent within a mobile application

Ketch allows end users to configure and deliver consent experiences across both web and in-app environments. The following article outlines the recommended approach when delivering and capturing consent within your mobile applications.

A typical user flow might look as follows:

  1. An event in the mobile app triggers the display of the privacy preferences. This can be a link or button the user clicks (e.g "Manage My Privacy Preferences.”) or you can decide that you would like to redirect the user to the privacy preferences screen automatically at a certain point in the app flow.

  2. The privacy preference center appears to the user via a WebView or in mobile web where they are able to give their consent to purposes you have configured in the Ketch console.

  3. A user submits their consent, closing the WebView and returning to the app.

Integration with the Ketch platform to support the user flow can be achieved in three steps:

  1. Create a webpage with the Ketch script tag on the page as described here. This page should additionally include a function call to invoke the Ketch privacy preference center experience and register a callback to close the WebView once the user has given their consent using the following snippet:
semaphore.push(['onHideExperience', function() {
    // implement your code to close the WebView here

The Ketch experience will be overlaid on top of this page.

  1. In the head of the page above the Ketch script tag, save the identifying information about the user in one of three places where Ketch can access it:
    a) as a window variable,
    b) as a cookie,
    c) or in the dataLayer.

When creating the property in the Ketch UI you can choose ‘Custom Identity Spaces’ to configure the user ID to which user consent is stored against


This must match the location you specified in the corresponding property in the Ketch UI. We recommend you pass any mobile identifiers present in the app as query parameters so they are available for you to store on the page.

This step is important as the presence of the mobile identifiers allow Ketch to store consent preferences assigned to a specific mobile device.

  1. Update your app to open a WebView directed to the page you created in step 1 using the query parameter for identity you defined in step 2.