Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 17 Next »

Pro or Enterprise Subscription Required


This AMPLIFY Appcelerator Services feature requires a Pro or Enterprise Subscription. 

This page describes how to use the AMPLIFY Appcelerator Services Analytics for native iOS applications, built with Objective-C and the iOS APIs.

Not developing a native iOS application with Objective-C?

See the following topics to use the Appcelerator Analytics Service on other platforms:


For native Android applications built with Java, see APS Analytics for Android.


For Titanium Applications, see Appcelerator Analytics.


    Page not found for multiexcerpt macro.
The page: Appcelerator Analytics was not found. Please check/update the page name used in the 'multiexcerpt-include macro.


    Page not found for multiexcerpt macro.
The page: Appcelerator Analytics was not found. Please check/update the page name used in the 'multiexcerpt-include macro.

Getting Started

To integrate the Performance service with a new or existing iOS application:

  1. Go to the Dashboard and create a new native iOS application.
  2. Download the Services SDK and get your Analytics application key.
  3. Unpack the appcelerator-sdk-ios-<VERSION>.zip file.
  4. Drag the Appcelerator.framework folder into your Xcode project's root folder if you are using Xcode 6 and above, or the  Frameworks folder if you are using Xcode 5 or below. 
  5. Select Copy items into destination… and click Finish.
  6. Select your project in the Project Navigator and click the Build Phases tab.
  7. Expand the Link Binary With Libraries section and add the  libsqlite3.dylib and libz.dylib frameworks.
  8. Click the Build Settings tab, then click the All button in the top-left corner of the tab.
  9. Expand the Linking section and add -ObjC  to Other Linker Flags.
  10. In your application delegate implementation file, import Appcelerator/Appcelerator.h.

  11. In the application delegate's application:didFinishLaunchingWithOptions method, enable the service by calling the APSServiceManager's enableWithAppKey: method. 


    To get your APS App key:

    1. Go to the Dashboard.
    2. Select your application from the Apps drop-down menu.
    3. Click the Overview tab.
    4. Click the Services button.
    5. Click Show Key under the Analytics and Cloud section.

The iOS application can now send user session events and make additional method calls using the APSAnalytics class .

Advanced Initialization Options

Session Timeout

By default, after the application has been back grounded for 30 seconds, the Analytics service ends the current user session and starts a new one when the application enters the foreground again. To adjust the timeout, use the sessionTimeout property.

Creating Custom Events

You use the A PSAnalytics API to log and report custom events. Feature Events  are for capturing a user action, such as selecting a specific menu option or launching a video.


Currently, the optional data parameter of the Titanium.Analytics methods, which is used to log a dictionary object, cannot be accessed through the Dashboard.

Feature Events

You use the  sendAppFeatureEvent:payload method to generate a feature event that captures a specific application or user activity. A feature event should represent an action, such as launching a video, or 'new item', 'launch video', and so forth. The name you assign to a feature event should incorporate the application state into the event name, rather than long descriptive names. The following naming convention is suggested, where group.event refers to the parent event:


Feature event names should be as generic as possible. For instance, if you want to track when users select a certain menu option, use a name like  "",  not "". The first option is better because it groups all the same types of an event into a single metric that's easy to view on Dashboard. The person analyzing the data only has to look at a single number to get an overview of how many users have selected that menu option. The second might be fine for very small user bases, but if you have more than 100 users it means that the person analyzing the data would have to look through 100 different event names to be able to generate any useful data.

For example, to track a user's menu selection you might use the following code, where the 10 digit number uniquely identifies the selection in your code: 

Good Practice: Track the State with the Naming Syntax

You should avoid using long, descriptive event names, as shown below:

Bad Practice: Avoid Long Descriptions

Geo Events

Use the sendAppGeoEvent to send real-time geographic data to the Analytics service. Pass the method a CLLocation object containing the location data. For example, you can use locationManager: didUpdateLocations delegate method to send geo-events when the device receives new location data. 

  • No labels