Does anyone know when the Ionic Cloud will release its Analytics feature? Is it worth using Google Analytics for now as an interim solution or will the release be soon enough for me to wait? I have an app that I am looking to release within the next three months, does anyone know if analytics will be available within this period?
@mhartington Hello Mike!
Do you have any informations about Ionic Cloud Analytics?
Is it expected to be compatible with ionic 2? If yes, do you plan to create an API to export the data?
I do not ask to have a date but I just need to know if I can count on this solution
Thank you in advance for your return!
See this Ionic Blog post, under the heading Refocusing the Ionic Cloud
With that in mind, we have made the tough decision to stop development on Ionic Analytics and will be sunsetting that product by early 2017. We realized that we werenāt providing enough value over existing analytics tools, and that we could be putting that engineering effort into unique Ionic services around Progressive Web Apps and web-first realtime databases. This isnāt to say analytics wonāt be a part of a future product effort, but most likely will be integrated rather than a standalone experience.
Thank you very much @ccdex_chris
There are lots of options for analytics: Flurry, Facebook analytics for mobile apps, Google Analytics. I prefer Google Analytics as it allows me to view events in real-time (and itās easy to implement).
hi @frontweb; iām user ionic cloud for auth and iām want to get analytics per user with google analytics. any help please???
Hereās the code that I use:
- Add this line in config.xml:
<plugin name="cordova-plugin-google-analytics" spec="~1.7.4" />
then on the command line run:
cordova plugin add cordova-plugin-google-analytics
-
Create a new file: src/providers/analytics.ts:
import {Injectable, Inject} from ā@angular/coreā;
declare var ga: any;/*
Interface to Google Analytics cordova plugin
https://github.com/danwilson/google-analytics-plugin
*/
@Injectable()
export class Analytics {
constructor() {
}init() {
if (!this.enabled()) return;ga.startTrackerWithId('PUT_YOUR_GOOGLE_ANALYTICS_TRACKER_ID_HERE'); // tracker it start with "UA-"
}
setAppVersion(appVersion: string) {
if (!this.enabled()) return;ga.setAppVersion(appVersion);
}
setUserId(userUuid: string) {
if (!this.enabled()) return;ga.setUserId(userUuid);
}
trackView(screenTitle: string) {
if (!this.enabled()) return;ga.trackView(screenTitle);
}
private enabled() {
if (!window[āgaā]) {
// console.log(āGoogle Analytics plugin not available or tracker ID not setā);
return false;
}return true;
}
} -
Declare your service in app.module.ts:
import {Analytics} from āā¦/providers/analyticsā;
providers: [
Analytics
] -
Initialize Google Analytics when your app starts up and the cordova plugins are ready. In app.components.ts add this:
import {Analytics} from āā¦/providers/analyticsā;
constructor(private analytics: Analytics) {
platform.ready().then(() => {
this.analytics.init();
});
} -
Then in every page you want to track you import the Analytics service and you can use:
ionViewDidLoad() {
this.analytics.trackView(āHomeā);
} -
After a user logs in you can let Google Analytics know about the user id with:
this.analytics.setUserId('USER_ID');
Since this code uses a cordova plugin youāll be able to test it only on a device/simulator. The nice thing about Google Analytics is that it provides a real-time visualization which make it easy to test different events while developing your app.
To see more methods that you can use with this cordova plugin you can check:
Why not use the ionic-native wrapper?