Open damirarh opened 1 year ago
Imported comment written by Dodo Mui on 2019-06-03T12:28:33
I'd like to setup Google Analytics for Ionic 4.
While I try to declare in app.module.ts providers: [GoogleAnalytics].
Receive below error
compiler.js:2430 Uncaught Error: Invalid provider for the NgModule 'AppModule' - only instances of Provider and Type are allowed, got: [?[object Object]?, ...]
Imported comment written by Damir Arh on 2019-06-03T20:01:45
Did you use the correct import for GoogleAnalytics? It should be:
import { GoogleAnalytics } from '@ionic-native/google-analytics/ngx';
Note the "ngx" at the end - this has changed in Ionic 4 (Ionic Native 5 to be exact).
Imported
URL: https://www.damirscorner.com/blog/posts/20170825-GoogleAnalyticsSendTimeoutInIonic.html