When will Ionic Analytics be released in Ionic Cloud?


#1

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?


#2

@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 :wink:

Thank you in advance for your return!


#3

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.


#4

Thank you very much @ccdex_chris :wink:


#5

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).


#6

hi @frontweb; i’m user ionic cloud for auth and i’m want to get analytics per user with google analytics. any help please???


#7

Here’s the code that I use:

  1. 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

  1. 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;
    

    }
    }

  2. Declare your service in app.module.ts:

    import {Analytics} from “…/providers/analytics”;
    providers: [
    Analytics
    ]

  3. 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();
    });
    }

  4. Then in every page you want to track you import the Analytics service and you can use:

    ionViewDidLoad() {
    this.analytics.trackView(‘Home’);
    }

  5. 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:


#8

Why not use the ionic-native wrapper?