nuxt: Implement cookie banner and analytics tracking#5064
Conversation
✅ Deploy Preview for flowforge-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Hey @ZJvandeWeg, before we merge #5065, do you think we could get this PR reviewed and merged? It brings over the cookie banner and analytics stack (HubSpot, PostHog and GTM) from the Eleventy site, so all Nuxt pages share the same tracking and consent setup. |
| @@ -0,0 +1,61 @@ | |||
| <!-- Google Consent --> | |||
There was a problem hiding this comment.
@Yndira-E I don't quite understand why we wouldnt depend on the SEO package from Nuxt?
There was a problem hiding this comment.
The main reason for this approach is to keep a single source of truth for consent and analytics (GTM, Consent Mode, PostHog and HubSpot) while Eleventy and Nuxt coexist.
Once the migration is complete and Eleventy is no longer part of the stack, we can revisit the implementation and evaluate whether Nuxt-native solutions make more sense.

Description
This PR enables Nuxt-rendered pages to share the same cookie banner and analytics stack (GTM, PostHog, HubSpot) as Eleventy pages.
base.njkinto shared HTML partials atsrc/_includes/analytics/_li_dcdm_c,_li_ss) persisting after consent withdrawal on production —autoClearonly cleared from the current host, not from the root.flowfuse.comdomainautoClearincookieconsent-config.jsdev:nuxtscript that loads the root.envconsistently with other dev scriptsWhen the migration to Nuxt is complete, the shared HTML partials and Nitro plugin should be replaced with a native Vue plugin using vanilla-cookieconsent's official Vue integration.
The current approach was chosen to avoid duplicating the current cookie consent configuration (categories, callbacks, GTM/PostHog/HubSpot integrations) across both frameworks during the migration period. One source of truth, zero risk of the two implementations drifting apart.
Related Issue(s)
Checklist