Switching Consent Platforms: OneTrust to Pandectes
Introduction
If you previously used OneTrust and are now switching to Pandectes GDPR Compliance, you should remove the OneTrust implementation and replace any consent-dependent functionality with the corresponding Pandectes setup.
Running two Consent Management Platforms at the same time can cause duplicate banners, conflicting consent signals, scripts remaining blocked after consent, or scripts firing without the appropriate consent.
Follow the steps below to fully migrate your setup.
Step 1: Remove OneTrust from your theme
Go to:
Online Store > Themes > Edit code > Layout > theme.liquid
Search for OneTrust scripts such as:
cdn.cookielaw.org
OtAutoBlock.js
otSDKStub.js
OneTrust
OptanonWrapper
A typical OneTrust implementation may look similar to:
<script
type="text/javascript"
src="https://cdn.cookielaw.org/consent/YOUR-DOMAIN-ID/OtAutoBlock.js">
</script>
<script
src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js"
type="text/javascript"
charset="UTF-8"
data-domain-script="YOUR-DOMAIN-ID">
</script>
<script type="text/javascript">
function OptanonWrapper() { }
</script>
Remove the OneTrust CMP scripts that are no longer required.
OneTrust documents both OtAutoBlock.js and otSDKStub.js as part of its Shopify implementation.
Step 2: Replace OneTrust manual script blocking
OneTrust may modify scripts so that they do not execute until the visitor accepts the corresponding cookie category.
For example:
<script
type="text/plain"
class="optanon-category-C0004"
src="https://example.com/tracking.js">
</script>
When removing OneTrust, do not simply change these scripts back to normal JavaScript if they still require prior consent.
Instead, replace the OneTrust blocking markup with Pandectes manual blocking.
For example:
OneTrust:
<script
type="text/plain"
class="optanon-category-C0004"
src="https://example.com/tracking.js">
</script>
Pandectes:
<script
type="javascript/blocked"
data-cookiecategory="targeting"
src="https://example.com/tracking.js">
</script>
Pandectes supports the following categories:
functionality
performance
targeting
The script will remain blocked until consent for the corresponding category is granted.
For the complete implementation, follow our guide:
Manual Script Blocking Guide:
https://help.pandectes.io/en/article/manual-script-blocking-guide-191jvg5/
Pandectes manual blocking works with both inline scripts and externally loaded scripts.
Step 3: Replace OneTrust automatic blocking
If you were using OneTrust Auto Blocking through OtAutoBlock.js, you can use the Pandectes Auto Blocker instead.
Navigate to:
Pandectes > Settings > Auto Blocker
The Auto Blocker can automatically prevent selected third-party services and scripts from running according to the visitor's consent state.
For complete setup instructions:
Auto Blocker Setup Guide:
https://help.pandectes.io/en/article/auto-blocker-setup-guide-zq5rdh/
If a third-party script is not automatically detected, you can also create a Pandectes Custom Blocking Rule.
Custom Blocking Rules:
https://help.pandectes.io/en/article/how-to-set-up-custom-blocking-rules-1j8kgrq/
Custom rules are particularly useful for third-party services injected by apps or external domains.
Step 4: Replace the OneTrust GTM implementation
OneTrust can also be installed and used through Google Tag Manager.
Open your GTM container and check for:
- OneTrust CMP tags
- OneTrust Cookie Banner tags
- Custom HTML tags containing
otSDKStub.js - Tags containing
cdn.cookielaw.org - Variables using
OnetrustActiveGroups - OneTrust consent triggers
- Consent conditions based on OneTrust categories such as
C0001,C0002,C0003, orC0004
Remove or disable the OneTrust-specific configuration.
You can then replace it with the official Pandectes GTM Template.
Inside Google Tag Manager:
- Navigate to Templates
- Open the Template Gallery
- Search for Pandectes
- Add Pandectes CMP (Consent Mode)
- Create a new tag using the template
- Set the trigger to:
Consent Initialization – All Pages
You can then configure the consent requirements of your other GTM tags.
For the complete setup:
Integration with Google Tag Manager – Official Pandectes Template:
https://help.pandectes.io/en/article/integration-with-google-tag-manager-gtm-official-pandectes-template-6dbjz/
The Pandectes GTM template can manage Google Consent Mode signals and allow GTM tags to respond to the consent selected through the Pandectes banner.
Step 5: Replace OneTrust Google Consent Mode handling
If OneTrust was responsible for sending Google Consent Mode signals, this functionality should also be migrated.
Pandectes provides a native Google Consent Mode integration.
Navigate to:
Pandectes > Settings > Integrations > Google Consent Mode
Configure and enable the integration according to your setup.
If you are managing Google tags through GTM, we recommend also using the official Pandectes CMP GTM template.
Full guide:
Using Google Consent Mode Integration:
https://help.pandectes.io/en/article/using-google-consent-mode-integration-1xkfv6o/
Pandectes can provide consent states for Google Analytics, Google Ads and other Google services according to the visitor's consent choices.
Step 6: Replace custom OneTrust JavaScript and consent events
Some Shopify stores use OneTrust variables, JavaScript APIs, or events to run custom functionality after consent.
Search your theme and custom JavaScript for references such as:
OneTrust.
OnetrustActiveGroups
OneTrustGroupsUpdated
OptanonConsent
OptanonWrapper
Do not simply remove the consent condition if the associated script still requires consent.
Instead, you can use the Pandectes consent event.
Pandectes exposes:
Pandectes_Consent_Updateand provides consent information for the Pandectes cookie categories.
For GTM/dataLayer implementations, see:
Cookie Consent Event in dataLayer:
https://help.pandectes.io/en/article/cookie-consent-event-in-datalayer-p7v670/
The event exposes the visitor's consent state and the status of the Functionality, Performance, and Targeting categories.
Step 7: Replace OneTrust logic inside Shopify Customer Events
OneTrust may also be referenced inside custom pixels under:
Shopify Admin > Settings > Customer events
Review your custom pixels for values such as:
OptanonConsent
OnetrustActiveGroups
OneTrust
If the pixel requires consent, replace the OneTrust-dependent logic rather than simply removing the consent check.
Pandectes provides a consent event that can also be used inside Shopify Custom Pixels.
For example:
analytics.subscribe("Pandectes_Consent_Update", event => {
// Run your custom consent-dependent code here
});
Full guide:
Use Pandectes Consent Event with Shopify Custom Pixel:
https://help.pandectes.io/en/article/use-pandectes-consent-event-with-shopify-custom-pixel-7l2qq3/
This allows custom code or integrations inside Shopify Customer Events to respond to consent managed through Pandectes.
Do not remove official Shopify app pixels unless they were specifically created or modified as part of your OneTrust implementation.
Step 8: Replace OneTrust Cookie Settings links
Some stores add a custom link or button that opens the OneTrust Preference Center.
Examples include:
<button id="ot-sdk-btn" class="ot-sdk-show-settings">
Cookie Settings
</button>
or JavaScript such as:
OneTrust.ToggleInfoDisplay()
Search your theme, footer, navigation and custom sections for:
ot-sdk-btn
ot-sdk-show-settings
ToggleInfoDisplay
Remove the OneTrust-specific implementation.
You can replace it with the Pandectes banner reopen functionality.
Enable:
Pandectes > Settings > Banner > Advanced > Custom Open / Reopen
Then use:
<a href="#reopenBanner">Cookie Preferences</a>
You can also use #reopenBanner as the URL of a Shopify navigation menu item.
More information:
Advanced Banner Settings:
https://help.pandectes.io/en/article/advanced-banner-settings-new-version-o0prb3/
Pandectes will then reopen the consent interface so visitors can review or update their choices.
Step 9: Remove or disable the remaining OneTrust implementation
Once the relevant OneTrust functionality has been replaced with Pandectes, make sure OneTrust is no longer being injected from:
- Shopify theme files
- Google Tag Manager
- Shopify Customer Events
- Custom JavaScript
- External tag-management platforms
If OneTrust was installed through a Shopify app, also disable or uninstall the corresponding implementation once the migration is complete.
Step 10: Verify the migration
Open your storefront in a new incognito/private browser window.
Confirm that:
- Only the Pandectes banner appears
- The OneTrust banner does not appear
- The OneTrust Preference Center does not appear
OtAutoBlock.jsis no longer loadingotSDKStub.jsis no longer loading- Requests to
cdn.cookielaw.orgare no longer present - Scripts requiring consent remain blocked before consent
- Those scripts load after the corresponding Pandectes category is accepted
- GTM receives the expected Pandectes consent signals
- Custom Pixels react correctly to Pandectes consent
- The Cookie Preferences link opens Pandectes instead of OneTrust
You can search your browser's Developer Tools > Network tab for:
onetrust
cookielaw
otSDK
OtAutoBlock
You should also test your important analytics and marketing services both before and after consent.
Last step
Once the migration is complete, follow our official installation guide to make sure Pandectes is correctly enabled on your store:
Pandectes Installation Guide:
https://help.pandectes.io/en/article/installation-guide-1ell1h8/
Your store should now use Pandectes as its Consent Management Platform without leaving any OneTrust consent logic or blocking configuration behind.
Updated on: 01/09/2026
Thank you!
