Used for transmitting developer-defined Analytics events to the Appcelerator Analytics product.
The Analytics module can be used to supply additional context or application-specific information which can then be accessed during analysis using Analytics.
Use the featureEvent method to generate custom events that you can view through the Analytics product. You can specify a name for the feature event which is visible through Analytics.
NOTE The Analytics module lets you transmit some data that is stored, but not made accessible through the Analytics UI. To access this data, you must sign up for the optional raw data export service.
The following types of data are stored but not made available through the Analytics UI:
Navigation events.
Extra data added to feature events (the data
parameter).
Viewing navigation events in the Analytics UI will be supported in a future version of the Analytics product. There is no plan to support the other event types, and they should not be used.
GDPR Compliance
The Ti.Analytics namespace in Titanium is GDPR compliant since SDK 7.2.0. End users should be able to opt out of Analytics using the optedOut property. If a user opted out from Analytics and you still call Analytics events, they will be ignored.
Note: This does not affect your app until you make use of the optedOut
property. Once
enabled for your users (e.g. by having a Titanium.UI.Switch in your settings), you
should handle it within your app logic.
This example shows how to send a feature event during an application session to indicate some feature that you would like to track was used.
Ti.Analytics.featureEvent('app.feature');
In this case, the Analytics product would show statistics about how many times the 'app.feature' event was generated.
The name of the API that this proxy corresponds to.
The name of the API that this proxy corresponds to.
The value of this property is the fully qualified name of the API. For example, Button
returns Ti.UI.Button
.
Indicates if the proxy will bubble an event to its parent.
Some proxies (most commonly views) have a relationship to other proxies, often established by the add() method. For example, for a button added to a window, a click event on the button would bubble up to the window. Other common parents are table sections to their rows, table views to their sections, and scrollable views to their views. Set this property to false to disable the bubbling to the proxy's parent.
Default: true
JSON representation of the last Analytics event generated.
JSON representation of the last Analytics event generated.
LastEvent is the JSON version of the last event prepared to be sent to Appcelerator during the application's session. This value may be null or undefined if no such event was queued.
The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.
The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.
If this property is set to a Window or TabGroup, then the corresponding Activity lifecycle event callbacks will also be called on the proxy. Proxies that require the activity lifecycle will need this property set to the appropriate containing Window or TabGroup.
Allows the user to opt out from Analytics during runtime to comply to GPDR.
Allows the user to opt out from Analytics during runtime to comply to GPDR.
Once opted out, no Analytics events will be sent anymore. If implemented to the end user, ensure to check if the user is opted out before trying to send an Analytics event. In case you do not guard the Analytics call, it will be ignored silently.
Here is an example of a guarded Analytics call:
if (!Ti.Analytics.optedOut) {
Ti.Analytics.featureEvent('gdpr_rocks');
}
Read more about GDPR on the official website.
Sends a generic event for this application session. Not displayed in Analytics UI.
This method has been removed since 3.3.0
Event type.
Event name.
Extra data related to the event. Must be serializable as JSON.
Sends a feature event for this application session.
From version "6.0.0", the JSON that is being sent will be validated. The JSON can have a maximum of 5 nested levels, 1000 serialised byte length, 25 keys per level and key length of up to 50 characters.
If this is successful, you will get a return number of 0. -1 is returned if it is a JSON Validation error. -2 is returned if Analytics is disabled.
Event name, displayed in Analytics UI.
Extra data related to the event. Must be serializable as JSON.
It returns 0 if it is successful. Otherwise, it is an error.
Sets a list of events that will not be sent to the Analytics server.
List of events to be filtered.
Sets the value of the bubbleParent property.
New value for the property.
Sets the value of the lifecycleContainer property.
New value for the property.
Sets the value of the optedOut property.
New value for the property.
Sends a settings event for this application session. Not displayed in Analytics UI.
This method has been removed since 3.3.0
Event name.
Extra data related to the event. Must be serializable as JSON.
Send a timed event for this application session. Not displayed in Analytics UI.
This method has been removed since 3.3.0
Event name.
Event start as a Date object.
Event end as a Date object.
Event duration.
Extra data related to the event. Must be serializable as JSON.
Sends a user event for this application session. Not displayed in Analytics UI.
This method has been removed since 3.3.0
Event name.
Extra data related to the event. Must be serializable as JSON.