Nuxt: How to add content/scripts to the head dynamically on server side
问题 How can I add dynamically content to the head in Nuxt on server side? I was trying to rewrite this module here which supports only static id's: https://github.com/nuxt-community/modules/blob/master/packages/google-tag-manager/index.js (My id is coming from the store (The store is fetching the id from a rest call)) This is the function which is adding the content to the head: export default function addheadcode(head, id) { const options = { id: id, layer: 'dataLayer', pageTracking: true,