Skip to content

Unable to add rel="preconnect"  #163

@17agustin

Description

@17agustin

I was looking at how the script tag is loaded in the page and I found out that there was no rel attribute. I checked at the options of the package and I found this default list:

const defaults = {
  enabled: undefined,
  debug: false,

  id: undefined,
  layer: 'dataLayer',
  variables: {},

  pageTracking: false,
  pageViewEventName: 'nuxtRoute',

  autoInit: true,
  respectDoNotTrack: true,

  scriptId: 'gtm-script',
  scriptDefer: false,
  scriptURL: 'https://www.googletagmanager.com/gtm.js',
  crossOrigin: false,

  noscript: true,
  noscriptId: 'gtm-noscript',
  noscriptURL: 'https://www.googletagmanager.com/ns.html'
}

So basically there's no easy way to add a rel="preconnect" to the script tag. It would be good to have that in the options either as default or not. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions