Adrian Javier
 · Pun Enthusiast

The Studio Integration with OneTrust

*Please note: Some features needed for the OneTrust integration are a part of an early-access release program. If you’d like access to these features please reach out to your Customer Success Manager

The Studio integration with OneTrust can help give you more control over cookie compliance while working with your existing Consent Management Platform. This article will focus on how to set up our OneTrust integration— for background on Cookie Compliance and GDPR, start by checking out our overview on Cookie Consent and GDPR Compliance here.  

To set up your integration with OneTrust, first navigate over to the OneTrust website and log into your account. Then follow these steps:

  1. Go to app-eu.onetrust.com

  2. Navigate to the Cookie Compliance App

  3. Add a Website

    • Here, either copy view.ceros.com or your vanity domain, and paste as the “website”

  4. Cookiepedia

    • The first step here is to name your cookie. There are two cookies to set up: “Ceros Domain Tracking”, “Ceros Experience Tracking”—this process applies to both. 

    • Host: view.ceros.com

    • Lifespan: Persistent

    • Duration: 365 Days

    • Default Category: Functional Cookie

    • Cookie Description: Ceros Analytics

    • Domain – view.ceros.com (or your vanity domain)

      • If you’re adding this to a standalone experience or an experience using a vanity domain you can add this as a first party cookie. If the experience is embedded and using a view.ceros.com URL, the cookies will be third party cookies

  5. Add a General Vendor

    • Select the website you set up the cookie for – CEROS, INC.

    • Privacy Policy : https://www.ceros.com/privacy-policy/

    • Description: Ceros is a design platform used by leading brands to produce web content without code. More information: https://www.ceros.com/platform/studio/ 

    • What region applies to the vendor? – Configuration depends on where you are distributing content.  (generally select everything)

    • Categorization: functional cookies

    • Associate cookie you previously created with with ceros the vendor

  6. Scripts

    • On the “Scripts” page, click the name of the website you created in Step 3.

    • If you are testing the implementation, before going to production (recommended):

      1. Click on the “Test Scripts” tab.

      2. Copy the “Testing CDN” script.

      3. Click the “Publish Test” button at the top-right of the page.

      4. Click “Confirm”

      5. Review the settings and click “Publish Test Scripts”

      6. With the script still copied to your clipboard, go to Step 7.

    • Once you are ready to publish, follow the steps above, but copy the script from the “Production Scripts” tab, and click the “Publish Production” button instead.

    • Note: You will need to publish the test or production script any time you make changes to the website, cookie, template, vendor, or geolocation settings in OneTrust.

  7. Open up the Studio and navigate to your settings panel.

  8. From here, the steps will vary for standalone vs. embedded content.  

For standalone content:

  • Open up cookie compliance tab 

  • Check the boxes to enable “Require User consent” and “Integrate with a CMP”

  • Then paste the code copied in step 6 into the Custom HTML window (see screenshot below)

Below, you can see an example of a OneTrust script. Note—you won’t want to use this script directly, you’ll need to copy it from OneTrust for each implementation!

<!-- OneTrust Cookies Consent Notice start for view.ceros.com -->
<script src="https://cdn.cookielaw.org/consent/65f89c14-f4cb-4427-92fd-1927b6d3b3a0-test/OtAutoBlock.js"></script>
<script src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js" type="text/javascript" charset="UTF-8" data-domain-script="65f89c14-f4cb-4427-92fd-1927b6d3b3a0-test">
<script type="text/javascript">
 function OptanonWrapper() { }
</script>
<!-- OneTrust Cookies Consent Notice end for view.ceros.com -->

Replace this part:

function OptanonWrapper() { }

With:

function applyConsent(hasConsent) {
 // If require isn't available, try again in a moment.
 if (typeof require === 'undefined') {
   return setTimeout(function() {
     applyConsent(hasConsent);
   }, 10);
 }

 require.config({
   paths: {
     CerosSDK: "//sdk.ceros.com/standalone-player-sdk-v5.min"
   }
 });

 require(['CerosSDK'], function(CerosSDK) {
   CerosSDK.findExperience()
     .done(function(experience) {
       experience.setUserConsentForAnalytics(hasConsent);
     })
     .fail(function(error) {
       console.error(error);
     });
 });
}

// Run it once to kick off the SDK loading
applyConsent(false);

/**
* OneTrust-specific code
* Function that runs any time there is a change to consent via OneTrust
*/
function OptanonWrapper() {
 applyConsent(OnetrustActiveGroups.indexOf('C0003') !== -1);
}

For Embedded Content

  • Open up cookie compliance tab 

  • Check the box to enable “Require User consent”

  • Paste the code copied in step 6 onto the page that contains the embedded experience, and replace:

<script type="text/javascript">
 function OptanonWrapper() { }
</script>

With:

<script type="text/javascript" src="https://sdk.ceros.com/embedded-player-sdk-v5.min.js"></script>

<script>
function applyConsent(hasConsent) {
  var foundExperienceInterval = setInterval(function() {
    var cerosFrames = document.querySelectorAll("iframe.ceros-experience");
    var cerosContainer = cerosFrames[0].parentNode;
    var expId = cerosContainer.getAttribute("id");
    if (expId) {
      clearInterval(foundExperienceInterval);
      // find experience
      CerosSDK.findExperience(expId)
        .done(function(experience) {
          experience.setUserConsentForAnalytics(hasConsent);
        })
        .fail(function(error) {
          console.error(error);
        });
    }
  }, 500);
}

// Run it once to kick off the SDK loading
applyConsent(false);

/**
 * OneTrust-specific code
 * Function that runs any time there is a change to consent via OneTrust
 */
function OptanonWrapper() {
  applyConsent(OnetrustActiveGroups.indexOf('C0003') !== -1);
}
</script>
2