Integrating Google Analytics into Ionic 2 Beta 9


Hey guys,

Trying to integrate Google Analytics ( ) into my app, followed this tutorial as the docs didn’t really have any sort of implementation instructions:

However, when I run my app I get the following error while compiling:

TypeScript error: app/app.ts(21,14): Error TS2339: Property ‘analytics’ does not exist on type ‘Window’.

UPDATE aaronksaunders posted a solution:


you could have just posted the link to the repo…


You’re right, sorry about that, didn’t mean any disrespect.


Thanks for the repo.

When adding custom dimensions (addCustomDimension), do we have to place the function call before the trackView like in the regular web Google Analytics?


you may find this link very useful


This above link used Javascript instead of Typescript. Do you have a solution for Google Analytics integration with Typescript?



Did you found any solution for that??

please try to declare window variable before @componet

declare var window;

i think its worked…