Ionic analytics - just set up and it does not get api analyics server



I just set up ionic analytics on my app.

And I got the error

        Error sending analytics data: Server responded with error....

I did a console log in the js file to find that the error is:
Cannot POST /undefined/api/v1/events/4e6fdd84

the /undefined - then, I found out was due to

which was defined as below:
getApiServer: function() {
return $ionicApp.getValue(‘analytics_api_server’);
}, (around line 49) of analytics.js

Can you please let me know where and how this gets defined? and how do I fix this error?



Quickstart with analytics error

Figured it out:

This is because of an outdated ionic-service-core
bower update ionic-service-core
Fixes this.