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:
Alternatives considered
Manual installation
Description
Add ability to specify whether to use GTM in the Angular application.
Proposed solution
Addition of a configuration field within
angular.jsonfor production builds:If specified, index.html shall be populated with required scripts in
<head>and<body>elements withgtmIdfrom angular.json during build.If
gtmIdis 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:
Autopopulates gtmId when the procedure is finished.
Alternatives considered
Manual installation