Skip to content

Google Tag Manager - Source optionΒ #482

@mattgrah-am

Description

@mattgrah-am

πŸ†’ Your use case

Is it possible to add the source option into the Google tag manager paramaters like it is in https://github.com/zadigetvoltaire/nuxt-gtm

/**
   * The URL of the script; useful for server-side GTM.
   *
   * @default https://www.googletagmanager.com/gtm.js
   */
  source?: string;

πŸ†• The solution you'd like

GoogleTagManagerOptions would include the ability to add the source as an option for server side GTM

export const GoogleTagManagerOptions = object({
  /** GTM container ID (format: GTM-XXXXXX) */
  id: string(),

  /** Optional dataLayer variable name */
  l: optional(string()),

  /** Authentication token for environment-specific container versions */
  auth: optional(string()),

  /** Preview environment name */
  preview: optional(string()),

  /** Forces GTM cookies to take precedence when true */
  cookiesWin: optional(union([boolean(), literal('x')])),

  /** Enables debug mode when true */
  debug: optional(union([boolean(), literal('x')])),

  /** No Personal Advertising - disables advertising features when true */
  npa: optional(union([boolean(), literal('1')])),

  /** Custom dataLayer name (alternative to "l" property) */
  dataLayer: optional(string()),

  /** Environment name for environment-specific container */
  envName: optional(string()),

  /** Referrer policy for analytics requests */
  authReferrerPolicy: optional(string()),
})

πŸ” Alternatives you've considered

No response

ℹ️ Additional info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions