x-govuk / govuk-eleventy-plugin

Write documentation using Markdown and publish it using GOV.UK styles.
https://x-govuk.github.io/govuk-eleventy-plugin/
MIT License
55 stars 14 forks source link

Add Google Tag Manager option #324

Closed nnagewad closed 1 month ago

nnagewad commented 2 months ago

This is a proposal to add Google Tag Manager to XGOV's Eleventy plugin.

This requires updating the base.njk layout by adding a conditional statement on whether a Google Tag Manager identifier is added via eleventy.config.js file.

paulrobertlloyd commented 1 month ago

Hmmm, this makes me very uneasy. There’s nothing worse than injecting somebody else’s JavaScript into a webpage… except perhaps Google’s JavaScript.

Appreciate the need, but in my opinion, some things should be difficult to achieve, and injecting third-party scripts is right up there on that list.

Making it easier to extend templates will be the way forward for making such changes, I think. I’ll start looking into how that may work soon.

In the meantime, maybe there are other ways we can enable extending the base template?