Consent-Gated Script Loader
Component Detail
Infrastructure
low complexity
Shared Component
frontend
1
Dependencies
0
Dependents
0
Entities
0
Integrations
Description
Infrastructure utility that manages deferred loading of third-party analytics and marketing scripts on the sales website. Scripts are registered with their required consent category and are only injected into the DOM once the Cookie Consent Service confirms the relevant category has been accepted.
script-loader
Responsibilities
- Register third-party scripts with their required consent category
- Inject approved scripts into the DOM after consent is granted
- Remove or neutralize scripts when consent is revoked
- Prevent duplicate script injection across page navigations
Interfaces
register(scriptConfig)
loadApproved()
unloadRevoked()
isLoaded(scriptId)