{"_id":"56d1f34000a2a70b00b365f2","__v":1,"version":{"_id":"56d1f33700a2a70b00b3658e","project":"5526c95cf69851170038b48f","__v":2,"createdAt":"2016-02-27T19:04:23.946Z","releaseDate":"2016-02-27T19:04:23.946Z","categories":["56d1f33900a2a70b00b3658f","56d1f33900a2a70b00b36590","56d1f33900a2a70b00b36591","56d1f33900a2a70b00b36592","56d1f33900a2a70b00b36593","56d1f33900a2a70b00b36594","56d1f33900a2a70b00b36595","56d1f33900a2a70b00b36596","56d1f33900a2a70b00b36597","56d1f33900a2a70b00b36598","56d1f33900a2a70b00b36599","56d1f33900a2a70b00b3659a","571f9497ada30c34003b7cee"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"beta","version_clean":"2.0.0-beta","version":"2.0.0-beta"},"category":{"_id":"56d1f33900a2a70b00b36595","project":"5526c95cf69851170038b48f","version":"56d1f33700a2a70b00b3658e","__v":1,"pages":["56d1f34000a2a70b00b365ee","56d1f34000a2a70b00b365ef","56d1f34000a2a70b00b365f0","56d1f34000a2a70b00b365f1","56d1f34000a2a70b00b365f2","56d1f34000a2a70b00b365f3","56d1f34000a2a70b00b365f4","56d1f34000a2a70b00b365f5"],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-04-10T15:44:07.282Z","from_sync":false,"order":5,"slug":"ionic-analytics","title":"Ionic Analytics"},"parentDoc":null,"project":"5526c95cf69851170038b48f","user":"5526ca4cf69851170038b496","updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-09-24T16:09:07.594Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Ionic Analytics is alpha software\",\n  \"body\": \"This API and the data you collect from it are both changing. But if you're willing to take the risk, you'll get a deeper record of your app's history. Find us on [gitter.im](http://gitter.im/driftyco/ionic-io-testers) if something doesn't work for you.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Ionic CLI Version\",\n  \"body\": \"You'll need the Ionic CLI version 1.6.5 or higher before you can follow this guide correctly.\"\n}\n[/block]\nThis guide walks through installing Ionic Analytics in your app. First make sure you have an existing Ionic app that has been uploaded with `ionic upload`. *Our [From Scratch](doc:analytics-from-scratch) can fill you in if you don't have one.*\n\nFirst add the platform web client:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ ionic add ionic-platform-web-client\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nThen add a call to register your app with the analytics service when it runs. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// www/js/app.js\\n.run(['$ionicAnalytics', function($ionicPlatform, $ionicAnalytics) {\\n  $ionicPlatform.ready(function() {\\n    $ionicAnalytics.register();\\n  });\\n}])\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n## Congratulations\nNow your app will collect data on user sessions. Try running through your app a couple of times (using `ionic serve`) to collect some data. Then check out the [dashboard](https://apps.ionic.io/apps) to view your analytics report. \n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"The [Overview](doc:analytics-auto-tracking) says what data Analytics collects and how you can use it to make decisions. The [Custom Events](doc:analytics-tracking) guide shows you how to monitor the trends that are important in your app.\",\n  \"title\": \"Neat\"\n}\n[/block]","excerpt":"","slug":"analytics-install","type":"basic","title":"Installation"}
[block:callout] { "type": "info", "title": "Ionic Analytics is alpha software", "body": "This API and the data you collect from it are both changing. But if you're willing to take the risk, you'll get a deeper record of your app's history. Find us on [gitter.im](http://gitter.im/driftyco/ionic-io-testers) if something doesn't work for you." } [/block] [block:callout] { "type": "danger", "title": "Ionic CLI Version", "body": "You'll need the Ionic CLI version 1.6.5 or higher before you can follow this guide correctly." } [/block] This guide walks through installing Ionic Analytics in your app. First make sure you have an existing Ionic app that has been uploaded with `ionic upload`. *Our [From Scratch](doc:analytics-from-scratch) can fill you in if you don't have one.* First add the platform web client: [block:code] { "codes": [ { "code": "$ ionic add ionic-platform-web-client", "language": "shell" } ] } [/block] Then add a call to register your app with the analytics service when it runs. [block:code] { "codes": [ { "code": "// www/js/app.js\n.run(['$ionicAnalytics', function($ionicPlatform, $ionicAnalytics) {\n $ionicPlatform.ready(function() {\n $ionicAnalytics.register();\n });\n}])", "language": "javascript" } ] } [/block] ## Congratulations Now your app will collect data on user sessions. Try running through your app a couple of times (using `ionic serve`) to collect some data. Then check out the [dashboard](https://apps.ionic.io/apps) to view your analytics report. [block:callout] { "type": "info", "body": "The [Overview](doc:analytics-auto-tracking) says what data Analytics collects and how you can use it to make decisions. The [Custom Events](doc:analytics-tracking) guide shows you how to monitor the trends that are important in your app.", "title": "Neat" } [/block]