Publishing and Integrating Cookie Scripts FAQ

When a user sets their cookie preferences, are they saved directly to the customer website or the OneTrust Cookie Consent application?

The user's preferences are stored in a cookie called OptanonConsent that is saved to the browser of the website visitor. For more information, see OneTrust Cookies.

You can also track the opt-in/opt-out rates in your dashboards by enabling the Capture Records of Consent setting in your geolocation rules. For more information see, Enabling Consent Logging and the Cookie Consent Dashboard.Enabling Consent Logging and the Cookie Consent Dashboard

Does Cookie Consent support the changes in the default browser settings for the SameSite attribute?

Yes, you can read more about the changes to OneTrust cookies to support the changes in SameSite in Setting SameSite Cookies and OneTrust Cookies.

Is the script ID affected when changes are made in the application to templates or geolocation rules, or when I re-scan domains?

No, the script ID does not change when templates or geolocation rules are modified or when a domain is re-scanned.

Which method is better for integrating the cookie Banner: via the head section of the code or a Google Tag Manager (GTM) tag?

Whichever you prefer; there are no comparative advantages to integrating the CDN through the head section of the code or GTM. However, it is not recommended to place the snippet in GTM if you are using auto-blocking.

What happens when a user clicks on close (‘X’) button on the cookie Banner?

If a site visitor decides to click on the close (‘X’) button on the Banner, the default consent model for that location as configured in geolocation rule groups would be honored.

When and where can we use the test scripts?

The test scripts are designed to be leveraged on any domain. Test scripts are not tied to the domain you scan in the tenant.

For instance, if the scanned URL is domain.com, but the testing website is www-test.staging.com, you can still use the test scripts from domain.com on this testing website. The only other step required is to ensure you publish the scripts before using them on the site.

For more information, see Implementing Cookie Consent Scripts.

When and where can we use the production scripts?

The production scripts are tied to the domain scanned in the OneTrust application.

For instance, if you scan domain.com, then the production script will only function on domain.com and any of its sub-domains, paths, or pages. If you try to integrate it on test.com, it will not work correctly; the banner will keep popping up on every page or every page refresh even if you have consented to it. In order to use the production scripts, you must publish them first.

For more information, see Implementing Cookie Consent Scripts.

Can I use the same script on different root domains?

Yes, it is possible to use one script across multiple root domains via Bulk Domain Management. Please note that this feature is currently available only for enterprise license types.

For more information, see Bulk Domain Management FAQ.

Can the consent be carried forward from one root domain to another root domain for an authenticated user?

Yes, it is possible for the consent to be shared across domains if the user is authenticated. This can be achieved via a cross-domain consent setup. Please note that this setting is not available by default and requires you to purchase a Consent Rate Optimization (CRO) license. You can speak with your account representative to purchase this license.

For more information, please see Cross-Domain and Cross-Device Consent.

Do we need to add the script to a domain first and then run the scan, or vice versa?

Scripts will not be generated unless you add the domain for scanning.

When does the OneTrust script change and what are the changes?

The OneTrust Testing/Production CDN remains the same in all scenarios except:

  • When the auto-blocking setting is enabled/disabled.

    When auto-blocking is enabled, the source (src) of the script tag is modified to add OtAutoBlock.js. Make sure to copy and paste the new scripts on your website.



    Similarly, when auto-blocking is disabled, source (src) OtAutoBlock.js is removed from the script. Ensure you update the correct scripts on the website.

  • When ‘Enable language detection of scripts’ is updated from corresponding to the visitor’s browser settings to corresponding to the language from the HTML page and vice-versa

    If Determine the language from HTML page is chosen, a new attribute, data-document-language="true" is added to the script tag. Make sure to copy and paste the new scripts on the website when enabling this option



    Similarly, when the language determination is chosen from Visitor’s browser settings, the attribute data-document-language is removed. Be sure to update to the correct scripts on your website.

Why does the status of a template and its geolocation rule group remain in Draft even after publishing test scripts?

The status of a template and geolocation rule group changes from Draft to Active when production scripts are published.

Can I test the consent carrying forward from root domain to sub-domain using test scripts?

The testing CDN is meant for testing purposes, and it is not domain-specific to the website scanned within the OneTrust tool. The testing CDN writes OneTrust cookies to the domain it is currently on, allowing it to behave like a Production CDN script in a testing environment. While using the testing CDN, it is not possible to test consent carrying forward from root domain to sub-domain and vice-versa.

When should we publish the testing CDN or production CDN?

When there is any change within OneTrust tool across categorizations, templates, geolocation rule groups, etc. you are required to publish the testing CDN or production CDN to view the changes on test or production site, respectively.

Without publishing the scripts, the changes will not reflect on test or production website.

Can we publish multiple domains at once?

Yes, you can bulk publish domain scripts. This functionality is currently available for preview. To enable this feature, contact OneTrust support.

How can I change the default Cookie Settings button or link text that is placed in the footer?

In the Content section of your Banner template, select Button Set. When configuring how the button will display on a web page, you can select Show other text and enter your desired text. Please note that if you would like to apply this change for all geolocations, you will have to make this change to all the templates you have assigned in your geolocation rule group.

For more information, see Customizing the Banner Template.