When a visitor first loads a site with the Ketch Smart Tag on to it, the Ketch Smart Tag runs through a series of tasks to determine the appropriate actions it must take based on various pieces of information.

Set language

The Ketch Smart Tag will use various methods to determine the language to use within the various experiences displayed by the Ketch Smart Tag:

  1. check to see if the language was set within a query string parameter
  1. check if the lang attribute on the <html> tag as been set
<html lang="en">
  1. check if the xml:lang attribute on the <html> tag has been set
<html xml:lang="en">
  1. check the language setting on the browser
  2. check the language default in the configuration
  3. default to en, if language is not set in one of the other places

Verify environment

To guard against clickjacking and unauthorized use of your banner, we validate the URL of the site against the pattern set on the property during the configuration of Ketch.

If the environment loading the Ketch Smart Tag is not valid, then the Ketch Smart Tag will discontinue its processing and not display any consent banner or preference management center.

Determine visitor's jurisdiction

To identify which jurisdiction applies to the visitor, the Ketch Smart Tag will use one of two methods:

  1. a custom variable configured for the property populated by custom code on the website
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({customJurisdiction: "us_california"}); 

// customJurisdiction: variable name. 
// us_california: the system generated code for the jurisdiction you want
  1. the geographic region from which the visitor is currently visiting the site. To determine the users geographic region, the Ketch Smart Tag will use the visitor's IP address to geolocate them. Once their geographic region is determined, it is used to determine the jurisdiction which applies for the visitor.

Get full configuration

With the jurisdiction determined, the Ketch Smart Tag will retrieve the full configuration containing, but not limited to the following:

  • jurisdiction in which the user was determined to be
  • purposes configured for the jurisdiction
  • regulations applicable to the jurisdiction
  • experiences configured for the jurisdiction
  • identities expected configured for the property in which the Ketch Smart Tag is running
  • client side plugins installed from the Ketch Marketplace
  • theme used when displaying experiences

Collect identities

Once the configuration is obtained, the Ketch Smart Tag will collect all identities configured on the property.

At least one identity configured on the property must be present on the page, otherwise the Ketch Smart Tag cannot continue and will not display any banner. Identity is one of the key drivers of the Ketch Smart Tag as it is what we store and retrieve consent against.

Retrieve consent

The Ketch Smart Tag will then query the Ketch Platform for the user's consent choices using the collected identities. All user consent choices are stored as permits within the Ketch Permit Vault.

Show consent experience, if required

Based on the consent choices returned for the identities on the page, the Ketch Smart Tag will determine if the consent should be shown because one of the following reasons:

  • no consent was found for any of the identities on the page
  • there is a conflict between consent for the identities on the page
  • there has been a change with the purposes configured for the jurisdiction