nuxt-community / legacy-modules

MIT License
1.29k stars 156 forks source link

scriptURL is not taken in consideration #200

Open calbazasebastian opened 6 years ago

calbazasebastian commented 6 years ago

If I'm not missing something the scriptURL from the options needs to be added also See https://github.com/nuxt-community/modules/blob/8b451c1ae956ce04be6eb8a95bc98b29bc4a961b/packages/google-tag-manager/index.js#L7

This question is available on Nuxt.js community (#c118)
uto-usui commented 6 years ago

I am the same.

  let currentOptions = {
    id: options.id || null,
    layer: options.layer || 'dataLayer',
    env: {
      gtm_auth: options.env && options.env.gtm_auth || null,
      gtm_preview: options.env && options.env.gtm_preview || null,
      gtm_cookies_win: options.env && options.env.gtm_cookies_win || 'x'
    },
    scriptURL: options.scriptURL || null
  }

☝️ In this way we need to pass scriptURL to currentOptions.