Salesforce

Configuring Audience Logic Using Geolocation Rules

« Go Back
Information
Configuring Audience Logic Using Geolocation Rules
UUID-35dcf48b-97af-38c8-1ef2-39f3da694732
Article Content

Audience Logic is a feature within the geolocation rules section that enables you to apply conditional logic to your individual geolocation rules to create a more customized Consent Management Platform (CMP) experience based on specific attributes of your end user.

Note

Audience Logic is only available for use with the Consent Rate Optimization add-on. To enable Consent Rate Optimization, contact OneTrust Support.

To configure Audience Logic

  1. On the Cookie Consent menu, select Geolocation Rules. The Geolocation Rule Groups screen appears.

  2. Select a geolocation rule group from the list. The Geolocation Rule Group Details screen appears.

    Note

    For information on creating a new rule group, see Configuring Geolocation Rules.

  3. Select the Use Audience Logic checkbox to enable Audience Logic.

  4. Enter a name and define the logic for your condition.

    audience_logic_1.png
  5. Click the Save button. Your Audience Logic condition displays.

    audience_logic_2.png

Each condition has its own set of geolocation configurations. Else configurations will load if the Audience Logic condition is not met or is unknown.

Example Configuration: GPC

When the Global Privacy value is TRUE, the condition will be hit.

If TRUE:

audience_logic_1.png
gpc_1.png
gpc_2.png

You can leverage the following code in the JavaScript entry field to load your configurations for the GPC condition:

navigator.globalPrivacyControl

If Else (FALSE/undefined):

gpc_3.png
gpc_4.png

Example Configuration: Mobile Devices

Present the end user with a different CMP experience when the browser user agent is in the defined mobile device list.

mobile_1.png

You can leverage the following code in the JavaScript entry field to load your configurations for the mobile condition:

/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)

Example Use Cases

Detect if the page is an iframe

If the page is loaded in an iFrame, hide the banner and opt out of all preferences.

Logical Condition:

window.top !== window.self

Example:

IF window.top !== window.self is TRUE,

THEN hide the banner AND set consent to opt-out.

Detect if browser is Safari

Show a banner if the user is visiting from Safari. If not, do not display the banner.

Logical Condition

navigator.userAgent.indexOf('Safari') != -1 &&

navigator.userAgent.indexOf('Chrome') == -1 &&

navigator.userAgent.indexOf('CriOS') == -1 &&

navigator.userAgent.indexOf('FxiOS') == -1

Explanation

This condition checks if the user agent contains "Safari" but excludes Chrome and Firefox on iOS (as they also include "Safari" in their user agents). If "Safari" is found and none of the other browsers are present, the visitor is using Safari.

Example

IF navigator.userAgent.indexOf('Safari') != -1 &&

navigator.userAgent.indexOf('Chrome') == -1 &&

navigator.userAgent.indexOf('CriOS') == -1 &&

navigator.userAgent.indexOf('FxiOS') == -1 IS TRUE

THEN Safari is being used, so show the banner.

ELSE Safari is not being used, so do not show the banner.

Things to Know

  • When consent logging is enabled, a collection point will be created per condition. You cannot use the field to write a cookie or a variable.

  • Any browser values or custom variables must be available prior to the variable when using Audience Logic.

  • Audience Logic is not currently compatible with our CSP feature.

  • A limit of five audience logic conditions per geolocation rule is recommended to maintain optimal performance.

 
Article Visibility
4,778
Translation
English
Checked

Powered by