# Ionic Analytics - failed to include into app

**URL:** <https://forum.ionicframework.com/t/ionic-analytics-failed-to-include-into-app/34977>\
**Category:** ionic-v1\
**Created:** [October 18, 2015, 1:18pm UTC](https://forum.ionicframework.com/t/ionic-analytics-failed-to-include-into-app/34977 "2015-10-18T13:18:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShamilY](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/shamily/32/92641_2.png) [@ShamilY](https://forum.ionicframework.com/u/ShamilY)\
**Post date:** [October 18, 2015, 1:18pm UTC](https://forum.ionicframework.com/t/ionic-analytics-failed-to-include-into-app/34977/1 "2015-10-18T13:18:10Z")

</div>

Hi folks,

I’m trying to add Ionic Analytics service to my app and get the following error while trying in in the browser:

```
Uncaught Error: You must provide an app id and api key to identify your app before tracking analytics data.

```

Before that I did the following (in the folder of my app):

```
$ sudo npm install -g cordova ionic
$ ionic upload
$ bower install ionic-service-core --save
$ bower install ionic-service-analytics --save

```

While debugging the issue I’ve checked the following things:

1. I see the app created at my account at [ionic.io](http://ionic.io) with app id and app  
key
2. The same app id and app key are added to a file .io-config.json to my project
3. My module contains the following new code:

```
angular.module('main', [
      'ionic',
      'ionic.service.core',
      'ionic.service.analytics',
      ...
```

I run “gulp watch” and see the error: “Uncaught Error: You must provide an app id and api key to identify your app before tracking analytics data.” which leads to ionic-analytics.js. In case I remove ‘ionic.service.analytics’, from module pre-requisites the app works fine.

I didn’t find any suggestions how to specify my app key and app id in any way in the ionic doc. It seem like it’s assumed that if I did “ionic upload” correctly it should work out of box (apparently it’s not).

Could somebody point me out to my problem?

Thanks,  
Shamil

---

<div class="post-metadata">

**Author:** ![ShamilY](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/shamily/32/92641_2.png) [@ShamilY](https://forum.ionicframework.com/u/ShamilY)\
**Post date:** [October 21, 2015, 11:00am UTC](https://forum.ionicframework.com/t/ionic-analytics-failed-to-include-into-app/34977/2 "2015-10-21T11:00:26Z")

</div>

Small update on the issue. After few more attempts - I have create an app with ‘ionic start’ and followed the rest of instructions, and it worked fine for me.

Initially I created the app with yeoman, not native ionic.

So, for now the issue is not relevant any longer more me.

Thanks 😄
