Error "GoogleAnalytics plugin not installed", but it's already installed

On startup of my app which uses the Google Analytics plugin, I get a failure which says the plugin is not installed:

03-11 18:41:31.568 16699 16699 I chromium: [INFO:CONSOLE(15607)] "DEVICE READY FIRED AFTER", source: file:///data/user/0/com.ionic.viewapp/files/files//7bfffa2d/build/main.js?ionicCachebuster=96341 (15607)
03-11 18:41:31.580 16699 16790 V StatusBar: Executing action: styleDefault
03-11 18:41:31.589 16699 16699 I chromium: [INFO:CONSOLE(353)] "Native: tried calling GoogleAnalytics.startTrackerWithId, but the GoogleAnalytics plugin is not installed.", source: file:///data/user/0/com.ionic.viewapp/files/files//7bfffa2d/build/main.js?ionicCachebuster=96341 (353)
03-11 18:41:31.589 16699 16699 I chromium: [INFO:CONSOLE(358)] "Install the GoogleAnalytics plugin: 'ionic plugin add cordova-plugin-google-analytics'", source: file:///data/user/0/com.ionic.viewapp/files/files//7bfffa2d/build/main.js?ionicCachebuster=96341 (358)
03-11 18:41:31.598 16699 16699 I chromium: [INFO:CONSOLE(59713)] "Error enabling analytics: plugin_not_installed", source: file:///data/user/0/com.ionic.viewapp/files/files//7bfffa2d/build/main.js?ionicCachebuster=96341 (59713)

However if I attempt to install it, it says it’s already installed:

➜  directory-on-tap git:(master) ✗ ionic plugin add cordova-plugin-google-analytics
Plugin "cordova-plugin-google-analytics" already installed on android.

Plugin "cordova-plugin-google-analytics" already installed on ios.

I’ve seen a couple other people having a similar problem, but their solutions do not work for me:

  • I am calling this within the this.platform.ready() handler
  • My call to <script src="cordova.js"></script> is the first script loaded in index.html

Your system information:

Cordova CLI: 6.5.0
Ionic Framework Version: 2.0.1
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: 1.9.1
ios-sim version: 5.0.13
OS: macOS Sierra
Node Version: v7.5.0
Xcode version: Xcode 8.2.1 Build version 8C1002

Other suggestions are appreciated, thanks!

1 Like

I have the same problem.

Your system information:

Cordova CLI: 6.5.0
Ionic Framework Version: 2.1.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.1.3
ios-deploy version: 1.8.5
ios-sim version: 5.0.6
OS: macOS Sierra
Node Version: v4.2.6
Xcode version: Xcode 8.1 Build version 8B62

Any update on this @shawnlauzon?

or maybe @mhartington?

there is also related to this issue on danwilson/google-analytics-plugin

No, I’m still stuck on this.

Any luck on this? I’m having the same problem on iOS. Android is working fine.

Problem is still persistent for me on iOS but it works on Android.

Native: tried calling GoogleAnalytics.trackView, but the GoogleAnalytics plugin is not installed.

The plugin is installed and double checked. Any updates?

Don’t know if it’s really your answer, but, a long time ago I did face some problems too (the tracker was sometimes not started). I end up writing a provider which stack the events in live memory till the next time the plugin will be available

If you want to follow such a path, like if you have really really really no answers, you could have a look there, I documented my code:

don’t know how to link directly my post, search “I created a service like this” from peterpeterparker (me)