added google analytics code to the environment.prod.ts file and the ability to specify builds for each environment

pull/7/head
Chris Veilleux 2018-10-09 17:04:46 -05:00
parent e0e01da782
commit edd7c4747f
3 changed files with 18 additions and 3 deletions

View File

@ -6,7 +6,8 @@ WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
ARG selene_env
RUN npm run build-${selene_env}
# STAGE TWO: build the web server and copy the compiled angular app to it.
FROM nginx:latest

View File

@ -4,7 +4,9 @@
"scripts": {
"ng": "ng",
"start": "ng serve --open --proxy-config proxy.config.json",
"build": "ng build",
"build-dev": "ng build",
"build-test": "ng build",
"build-prod": "ng build --prod",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"

View File

@ -1,3 +1,15 @@
export const environment = {
production: true
production: true
};
document.write(
'<script async src="https://www.googletagmanager.com/gtag/js?id=UA-101772425-11"></script>'
);
document.write(
'<script>' +
'window.dataLayer = window.dataLayer || []; ' +
'function gtag(){dataLayer.push(arguments);} ' +
'gtag("js", new Date()); ' +
'gtag("config", "UA-101772425-11"); ' +
'</script>'
);