From 46a9b6d50d45ad010bf45b5cdb10a0d602191a24 Mon Sep 17 00:00:00 2001 From: Ibby Date: Tue, 27 Dec 2016 08:07:45 -0500 Subject: [PATCH] docs(google-analytics): add usage closes #883 --- src/plugins/googleanalytics.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/plugins/googleanalytics.ts b/src/plugins/googleanalytics.ts index 10eb523ff..a5f0f0918 100644 --- a/src/plugins/googleanalytics.ts +++ b/src/plugins/googleanalytics.ts @@ -10,6 +10,20 @@ declare var window; * - A Cordova 3.0+ project for iOS and/or Android * - A Mobile App property through the Google Analytics Admin Console * - (Android) Google Play Services SDK installed via [Android SDK Manager](https://developer.android.com/sdk/installing/adding-packages.html) + * @usage + * ```typescript + * import { GoogleAnalytics } from 'ionic-native'; + * + * GoogleAnalytics.startTrackerWithId('YOUR_TRACKER_ID') + * .then(() => { + * console.log('Google analytics is ready now'); + * // Tracker is ready + * // You can now track pages or set additional information such as AppVersion or UserId + * }) + * .catch(e => console.log('Error starting GoogleAnalytics', e)); + * + * + * ``` */ @Plugin({ pluginName: 'GoogleAnalytics',