Time for action – setting up Google Analytics
Perform the following steps to set up Google Analytics:
You need a key to uniquely identify your app. Register your app at Google Analytics (http://www.google.com/analytics). After registering you will get a tracking ID that will be something like UA-99999999-9. This will be the key used in your app.
Tip
A tracking ID has to be associated with a website and generating data for Google Analytics before Google will accept any data from this example. You cannot just create a new tracking ID for this example and expect it to work. Try using the same tracking ID as used on an existing website.
Grab the JavaScript analytics library originally written by Roger Chapman (https://gist.github.com/4441504) and put it in your project code base as a new file called
analytics.js
.Include the analytics library in your code. Add the following to
app.js
:Ti.include('analytics.js');
Add the code to set your tracking ID (replace the tracking ID shown next with your own...