CMS platforms
How to add the CookieBeam loader to Joomla, Drupal, Adobe Commerce, PrestaShop, Shopware, TYPO3, BigCommerce, HubSpot CMS, and Ghost.
Última atualização:
Joomla
In a maintained child or custom template, open index.php and paste the loader as the first line inside <head>, before any jdoc:include tags.
Joomla extensions and template asset calls that appear after your jdoc includes will load later than the loader. If your site uses analytics or tracking extensions, disable them or place them behind consent before relying on the banner.
Sources: Template folder structure (Cassiopeia). Verify: Installation checks.
Drupal
In your active custom theme, edit html.html.twig and paste the loader as the first line inside <head>, before the {{ head }} and JavaScript placeholder variables. Clear the Drupal cache after saving.
Libraries and contributed analytics modules that hook into the placeholder variables will load after the loader, as long as your template places them later. Disable optional tracking modules (or gate their libraries behind consent) before enabling the banner.
Sources: Drupal 11 html.html.twig. Verify: Installation checks.
Adobe Commerce and Magento
The admin field at Content > Design > Configuration > (store view) > HTML Head > Scripts and Style Sheets is convenient but does not guarantee that the loader runs before all generated assets. For reliable first-in-head placement and CSP header support, use a maintained theme or module that places the loader ahead of RequireJS and theme assets.
Disable optional Google tracking in Stores > Configuration > General > Web > Default Cookie Settings (Cookie Restriction Mode) and remove any analytics integration IDs that load before the banner. Verify that payment-page CSP headers are not weakened by a global rule.
Sources: Head field and CSP, Cookie Restriction Mode. Verify: Installation checks.
PrestaShop
Use a maintained child theme to place the loader in the head template, before any asset or hook output. Alternatively, register a module on the displayHeader hook and set its position under Design > Positions to load before other modules.
The displayHeader hook runs in the head but may not load before all theme assets. Disable analytics and tracking modules in Module Manager until they are gated behind consent.
Sources: displayHeader hook, Hook system. Verify: Installation checks.
Shopware
In a maintained storefront theme or plugin, use a Twig head override to place the loader before the parent template's assets. This approach requires self-hosted or PaaS extension access and is not available on SaaS plans without an app.
Shopware's storefront cookie-permission plugin and its tracking extensions maintain their own consent state. CookieBeam does not replace that state automatically, so disable optional analytics extensions until their consent is synchronized with the banner.
Sources: Template overrides, Cookie permission plugin. Verify: Installation checks.
TYPO3
In your site package's TypoScript, use PAGE.includeJS with forceOnTop enabled. Remove async and defer, and exclude the loader from concatenation and compression. Inspect the final rendered head to confirm the loader appears before all other scripts.
forceOnTop orders included JS files but does not guarantee precedence over all arbitrary headerData output. For strict first-in-head placement, put the loader in an owned head template before any other output. Remove tracking from earlier headerData entries and extensions.
Sources: PAGE options. Verify: Installation checks.
BigCommerce
In the storefront channel, go to Script Manager, create a script with location Head and category Essential. This approach requires a non-Blueprint storefront.
Script Manager does not guarantee that your script runs before all platform code. For stricter ordering, use a Stencil template to place the loader before the head script output. On Catalyst storefronts, scripts are deferred and need framework-specific treatment.
Remove optional analytics and tracking integrations from Security and Privacy settings unless their native consent is synchronized with CookieBeam.
Sources: Scripts API and Manager, Consent categories. Verify: Installation checks.
HubSpot CMS
Go to Settings > Content > Pages, choose a domain or the default settings, and paste the loader as the first line in Site Header HTML. This requires the Website settings permission; available options vary by content type and subscription.
HubSpot's own tracking code and template scripts may load before injected header HTML. If your site already uses a CookieBeam HubSpot bridge (which calls _hsq.doNotTrack and _hsp.revokeCookieConsent), verify that it still works before replacing the native banner. Disable optional tracking integrations until consent state propagation is confirmed.
Sources: Header HTML, Native consent listener. Verify: Installation checks.
Ghost
Go to Settings > Code Injection > Site Header and paste the loader as the first line. For stricter ordering, edit your theme's default.hbs and place the loader as the first line inside <head>, before the {{ghost_head}} helper.
Theme scripts that appear before {{ghost_head}} will always load first. Remove optional analytics from code injection, theme files, and integrations, or gate them behind consent. Code injection and theme access depend on your hosting plan.
Sources: Code injection. Verify: Installation checks.