Migrate from OneTrust to OptinStack
By OptinStack Team - Jul 1, 2026 - 2 min read
Use this guide if your GTM container currently depends on OneTrust variables such as OnetrustActiveGroups, OptanonConsent, OneTrustGroupsUpdated, or category IDs such as C0002.
OneTrust category IDs are tenant-specific. Confirm what each C000x group means before mapping it to OptinStack analytics, marketing, or preferences.
| OneTrust setup | OptinStack setup |
|---|---|
| OneTrust CDN script or Custom HTML tag | OptinStack runtime installed early in the page head |
OneTrustGroupsUpdated custom event | optinstack_consent_updated or category-specific accepted events, including optinstack_necessary_accepted |
OnetrustActiveGroups contains ,C0002, | Map the category ID to analytics, marketing, or preferences, then use the matching OptinStack event |
OptanonConsent contains C0002:1 | GTM Additional Consent Checks instead of OneTrust cookie parsing |
| Trigger groups that combine old OneTrust triggers with existing tag triggers | Existing business trigger plus OptinStack consent checks and category event when needed |
Before you start
- Export your GTM container or take screenshots of the current CMP tag, consent triggers, and affected tags.
- List every GTM tag that sets analytics, marketing, or preferences trackers. Do not rely on the old CMP category names alone.
- Decide whether your Google tags should use Basic or Advanced Consent Mode before changing triggers.
- Keep one CMP active at a time. Running the old CMP and OptinStack together can create conflicting consent defaults and updates.
Replace the CMP setup
- Remove the OneTrust GTM template, CMP script tag, or Custom HTML tag from the live container after you are ready to test OptinStack.
- Import the official downloadable OptinStack template under Templates > Tag Templates > New > Import. It is not currently published in the Community Template Gallery. Fire the OptinStack tag on Consent Initialization – All Pages.
- Install the OptinStack runtime as early as possible in the page head so direct scripts and iframes can be blocked before they run.
- Add the OptinStack GTM template and fire it on Consent Initialization - All Pages.
- Replace old CMP custom event triggers with OptinStack category events and GTM Additional Consent Checks.
Update tag consent settings
| Tag type | Trigger | Additional consent checks |
|---|---|---|
| Non-Google analytics tag | Custom Event: optinstack_analytics_accepted | analytics_storage |
| Marketing pixel or ad tag | Custom Event: optinstack_marketing_accepted, or your conversion trigger plus consent checks | ad_storage, ad_user_data, ad_personalization |
| Preferences, personalization, or A/B testing tag | Custom Event: optinstack_preferences_accepted | functionality_storage and/or personalization_storage |
| Tag that must respond to every consent edit | Custom Event: optinstack_consent_updated | The consent types required by that tag |
| Strictly necessary tag | Custom Event: optinstack_necessary_accepted, or normal page triggers when no consent gate is needed | security_storage |
A tag with only an All Pages trigger may miss its chance to fire on the first page after consent. Pair consent-gated tags with the relevant OptinStack custom event trigger. The necessary event exists too, but necessary is always granted and is usually not used to gate optional trackers.
Test before publishing
- Use GTM Preview and confirm the OptinStack consent tag fires on Consent Initialization before other tags.
- Reject all optional categories and confirm analytics, marketing, and preferences tags stay blocked.
- Accept one category at a time and confirm only the matching tags fire.
- Use Tag Assistant to confirm Google Consent Mode defaults and updates.
- Use DevTools Network and Cookies to confirm trackers are not sending requests or writing storage before consent.
- Run an OptinStack scan after publishing to catch hard-coded trackers that GTM cannot control.
Related articles
Migrating to OptinStack from another CMP
A migration hub for moving from Cookiebot, CookieYes, OneTrust, Axeptio, or another CMP to OptinStack without breaking GTM.
Integrate OptinStack with Google Tag Manager
Configure OptinStack with Google Tag Manager from start to finish, including the GTM template, Consent Mode v2 signals, defaults, triggers, consent settings, and testing.
Set up Google Consent Mode v2
Map OptinStack's four consent categories onto Google Consent Mode v2 and keep them in sync as visitors choose.
Install OptinStack on your site
Add the OptinStack script tag, load it without slowing your page, and confirm the consent banner renders.
Block trackers before they load
How OptinStack blocks trackers before they load, how scripts are tagged to consent categories, and how to allowlist essential scripts.
How helpful was this article?