Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trackingId removed when run production mode. #3

Open
insanehong opened this issue Aug 9, 2018 · 2 comments
Open

trackingId removed when run production mode. #3

insanehong opened this issue Aug 9, 2018 · 2 comments

Comments

@insanehong
Copy link

insanehong commented Aug 9, 2018

Hi,

I have problem that trackingId removed when run production mode.

application info

  • angular v6.0.6
  • angular-gtag v1.0.3

set Import

# environment.prod.ts

{
  .
  .
   GA_ID : process.env.GA_ID,
  .
  .
}
# app.module.ts
GtagModule.forRoot({ trackingId: environment.GA_ID, trackPageviews: true})

development mode

// in app.comonent.ts
console.log(Gtag) 
> Gtag {router: Router, mergedConfig: {}}
mergedConfig: {
 trackPageview: true, trackingId: "UA-122xxx040-2"

production mode

// in app.comonent.ts
console.log(Gtag) 
> Gtag {router: Router, mergedConfig: {}}
mergedConfig: {
 trackPageview: true, trackingId: null
@jonjaques
Copy link

Same here, though it doesn't seem to matter if it's in the environment files or not in NG7

@handylearn
Copy link

We have a project which uses webpack and have the same problem:
mergedConfig shows null for the trackingId in production.
we use angular 8.2.x and gtag 1.0.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants