Lifecycle

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
https://your_organization.com?ketch_lang=EN
  1. check if the lang attribute on the <html> tag as been set
<html lang="en">
...
</html>
  1. check if the xml:lang attribute on the <html> tag has been set
<html xml:lang="en">
...
</html>
  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 Tag is not valid, then the Ketch 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 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 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 configuration

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

  • jurisdiction in which the user was determined to be
  • purposes configured for the jurisdiction
  • rights configured for the jurisdiction
  • regulations applicable to the jurisdiction
  • experiences configured for the jurisdiction
  • identities expected configured for the property in which the Ketch Tag is running
  • client side plugins installed through the Ketch Systems page

Collect identities

Once the configuration is obtained, the Ketch 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 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 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

Get consent experience configuration

If it's determined a consent experience should be show, the Ketch Tag will retrieve the consent experience configuration containing the following information:

  • content to be displayed in the consent experience in the language determined at the beginning of the lifecycle
  • layout of the various consent experience components
  • theme information about how to display the consent experience