Google Analytics don't collect data or feedback



Im using the following plugin cordova-plugin-google-analytics
I have some problem with Google analytics, I use the code below in app.js , then use “ionic run android” on my phone to test. When I checked my analytics account, no data or feedback show on Google Analytics dashboard.

There is no message that indicated any error or that the plugin cant not be loaded?
All idea and help are welcome.

thank you in advance.

   // Initialize Google Analytics plugin
    function _waitForAnalytics(){
        var tracking_ID = device.platform == "Android" ? "UA-XXXXXXXX-X" :"UA-XXXXXXXX-X";;;;'home');
        console.log("GA activated");


This is what i use in controllers.js



You can put the initialization code in run block and wait for deviceready{

Also all methods of analytics plugin takes success and error handlers. You can pass one to see if the method is successful or is there any error.