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
-
On the menu, select . The Geolocation Rule Groups screen appears.
-
Select a geolocation rule group from the list. The Geolocation Rule Group Details screen appears.
-
Select the Use Audience Logic checkbox to enable Audience Logic.
-
Enter a name and define the logic for your condition.
-
Click the Save button. Your Audience Logic condition displays.
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:
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):
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.
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)
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.
-
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.