Skip to main content

How to Set Up a Cookie Consent Banner on Your Partner Directory with OneTrust

Stay compliant with GDPR and other user data protection regulations by adding a cookie consent banner to your partner directory using OneTrust

R
Written by Roberto Carozza
Updated over a week ago

If your organization already uses OneTrust for cookie consent management, you can easily integrate a consent banner into your directory. This helps ensure your PartnerPage directory meets your company’s privacy requirements.

This guide shows you where to find the proper configuration documentation in OneTrust and how to add the OneTrust script into your partner directory.

✅ Requirements

  • You have an active OneTrust account used by your organization for cookie consent

  • You have admin access to your organization’s PartnerPage account

1. Create and Publish Your Cookie Consent Script in OneTrust

To embed a cookie banner on your directory, you’ll first need to create and publish a consent script in your OneTrust account.

OneTrust provides a step-by-step support article to guide you through creating and publishing your cookie consent script.

Once published, you’ll be able to copy or download the script. It will look similar to this:

<!-- OneTrust Cookie Consent Script -->
<!-- This script loads the OneTrust cookie consent management -->

<script
src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js"
data-domain-script="acega15f-1e05-3d48-71b5-22e1337d4de2"
type="text/javascript"
charset="UTF-8">
</script>

<script>
function OptanonWrapper() { }
</script>

2. Add Your Embed Scripts to Your Directory

  • Log in to your PartnerPage dashboard at directory.partnerpage.io

  • Select the directory to which you want to add the cookie consent script and navigate to the Customizations > HTML, CSS, & JS nav item

  • Scroll down to the Scripts section. You will need to configure two new scripts for your directory.

  • Click Add script and configure the first new script. This corresponds to the first part of the OneTrust embed code:

    <script
    src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js"
    data-domain-script="acega15f-1e05-3d48-71b5-22e1337d4de2"
    type="text/javascript"
    charset="UTF-8">
    </script>

    In the script configuration:

    • Set Script type = JavaScript (text/javascript)

    • Choose External script (reference a script from a URL) and paste the URL from the src attribute: https://cdn.cookielaw.org/scripttemplates/otSDKStub.js

    • Add the following attributes:

      • data-domain-script = acega15f-1e05-3d48-71b5-22e1337d4de2

      • type = text/javascript

      • charset = UTF-8

      💡 The order of the attributes does not matter. Your OneTrust script may include additional attributes—add all of them as shown in your configuration.

    Your first script configuration should now look like this:

  • Next, add the second script, which corresponds to this portion of the embed code:

    <script>  
    function OptanonWrapper() { }
    </script>

    In the script configuration:

    • Set Script type = JavaScript (text/javascript)

    • Select Internal script (embed script content directly)

    • Paste the entire function from the code above

    Your second script configuration should now look like this:

  • After adding both scripts, make sure they appear as the first two scripts in the Scripts section. This ensures your cookie consent logic runs before any other code on the page. The correct order should look like this:

With these scripts added to your directory, your cookie consent banner will now appear upon page load and sync back to your OneTrust account!

Still need help? Reach out to PartnerPage support anytime.

Resources

Did this answer your question?