How do I stop Croct from tracking anything until the user accepts our consent banner?
I am integrating Croct on a site that operates under German data protection requirements, behind a consent management platform. Our requirement is strict: before the user opts in, there must be zero network requests to Croct and zero entries written to localStorage or cookies.
My questions:
- Is there a supported way to hold the SDK back entirely until the CMP reports consent?
- The track option defaults to true as far as I can tell. Does that mean automatic events fire as soon as the SDK initializes?
- What happens to the personalized sections of the page while consent is still pending? I would rather show sensible defaults than empty regions
Thank you for a thorough answer, I need to document this for our records.
1 answer
The supported pattern is to defer the croct.plug() call until your CMP grants consent. The SDK does nothing before it is plugged: no requests are sent and nothing is written to localStorage or cookies. Gating that single call satisfies your zero-requests, zero-storage requirement.
On your specific questions:
- Wire your CMP callback so that croct.plug({appId: '...'}) runs only after opt-in. If the user never consents, the SDK simply never initializes.
- Correct, track defaults to true once the SDK is plugged, which enables automatic events such as page views. Because those events only exist after plugging, gating the plug call gates all automatic tracking as well. There is nothing extra to disable.
- While the SDK is unplugged, slot fallbacks render the default content you define in code, so the page remains complete and functional before consent. Personalization activates on top of those defaults after the user opts in.
The plug options and fallback behavior are covered in the docs if you need the reference material for your records.