Usually including analytics was about pasting their tracking code in the html body, with the property Id and the pageview action. I followed the answer in
[Tracking Google Analytics Page Views in Angular2](https://stackoverflow.com/questions/37655898/tracking-google-analytics-page-views-in-angular2) and when doing `ng serve` it includes correctly the script but then when generating production aot it is not included in the index:

```
ng build --progress false --aot true -prod -e prod 

```

What is the best practice to include Google Analytics or other tracking solution with Angular2 Cli?

Thanks in advance