Skip to content

trackingId removed when run production mode. #3

Description

@insanehong

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions