Skip to content

Native support of Google Tag Manager via angular.json config #29785

@kozm9000

Description

@kozm9000

Description

Add ability to specify whether to use GTM in the Angular application.

Proposed solution

Addition of a configuration field within angular.json for production builds:

"configurations": {
            "production": { 
                   "gtmId": "GTM-XXXXXXXX"
                    } 
             }

If specified, index.html shall be populated with required scripts in <head> and <body> elements with gtmId from angular.json during build.

If gtmId is absent from configuration, no code is added to index.html during build.

Additional functionality

Have a special schematic that replicates creation of a New Account in GTM via web:

  • Prompts user to auth

  • Asks for:

    • Account Name
    • Country
    • Permission to share anonymous data
    • Container name
    • Target platform
  • Autopopulates gtmId when the procedure is finished.

Alternatives considered

Manual installation

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions