Provides access to the Omniture tracking and analytics service.
This iOS module requires iOS 6.0 or later. This Android module Requires Android 2.3.3 or later.
View the Using Titanium Modules document for instructions on getting started with using this module in your application.
Use require
to access this module from JavaScript:
var Omniture = require("ti.omniture");
The Omniture
variable is a reference to the Module object.
If you are upgrading from an earlier version of this module (prior to version 3.0.0) you should be aware that API of the module changed substantially to match the changes in the underlying native library.
The Ti.Omniture.Session class is no longer used. Instead of creating a Session
object using the startSession
function, basic parameters such as tracking
server address and suite IDs are specified in a configuration file called
ADBMobileConfig.json. Download a pre-configured instance of this file from the
Adobe Mobile Services web site and place it into the platform/iphone
folder
(for iOS) and into the platform/android/bin/assets
folder (for Android)
of your Titanium Alloy project.
The functions of the Session class have been replaced with functions of the module object itself.
The name of many functions has changed to match the native library. Also, the way parameters are provided has changed to allow for a more concise coding style.
For example, this:
session.trackAppState({
appState: "state1",
contextData: {
key: "value"
}
});
will become this:
Omniture.trackState('state1', { key: 'value' });
The Ti.Omniture.MediaTracker class is no longer used. Instead of creating a
MediaTracker object using the startMediaTracker
function, use the
createMediaSettings
function to create a Ti.Omniture.MediaSettings object
and pass it to the mediaOpen
function.
For example, this:
var mediaTracker = Omniture.startMediaTracker({
trackMilestones: "25,50,75",
contextDataMapping: {
"a.media.name": "eVar2,prop2",
"a.media.segment": "eVar3",
"a.contentType": "eVar1",
"a.media.timePlayed": "event3",
"a.media.view": "event1",
"a.media.segmentView": "event2",
"a.media.complete": "event7"
}
});
becomes this:
var mediaSettings = Omniture.createMediaSettings({
name: 'media1',
milestones: '25,50,75',
...
});
Omniture.mediaOpen(mediaSettings);
...
Omniture.mediaClose('media1');
Begins the collection of lifecycle data. This should be the first method called upon app launch.
Tracks a state with context data. This method increments page views.
Tracks an action with context data. This method does not increment page views.
Tracks an action with context data. This method does not increment page views. This method is intended to be called while your app is in the background (it will not cause lifecycle data to send if the session timeout has been exceeded).
Tracks a location with context data. This method does not increment page views.
Tracks an increase in a user's lifetime value. This method does not increment page views.
Tracks the start of a timed event. This method does not send a tracking hit If an action with the same name already exists it will be deleted and a new one will replace it.
Tracks the start of a timed event. This method does not send a tracking hit. When the timed event is updated the contents of the parameter data will overwrite existing context data keys and append new ones.
Tracks the end of a timed event
Returns whether or not a timed action is in progress.
Retrieves the Marketing Cloud Identifier from the Visitor ID Service. Querying this property can cause a blocking network call, therefore this is an async function: the result will be delivered to the provided callback function.
Retrieves the analytics tracking identifier. Querying this property can cause a blocking network call, therefore this is an async function: the result will be delivered to the provided callback function.
Force library to send all queued hits regardless of current batch options.
Clears any hits out of the tracking queue and removes them from the database.
Creates a Ti.Omniture.MediaSettings object with the specified properties.
The following properties are mandatory:
Creates a Ti.Omniture.MediaSettings object with the specified properties.
The following properties are mandatory:
The difference between createMediaSettings
and this function is that this
function sets isMediaAd to true by default.
Opens a media item for tracking.
Closes a media item.
Begins tracking a media item.
Artificially completes a media item.
mediaComplete
is called (in seconds).Notifies the media module that the media item has been paused or stopped.
Notifies the media module that the media item has been clicked.
Sends a track event with the current media state
Processes a Target service request.
createTargetLocationRequest
or createTargetOrderConfirmRequest
function.Creates a Ti.Omniture.TargetLocationRequest object.
Creates a Ti.Omniture.TargetLocationRequest object.
Clears target cookies from shared cookie storage.
Sets the DPID and DPUUID.
Processes an Audience Manager service request.
Resets audience manager UUID and purges current visitor profile.
Synchronizes the provided identifiers to the visitor id service
The version of the Omniture library.
The custom user identifier.
Note : If your app upgrades from the Marketing Cloud 3.x to 4.x SDK, the previous visitor ID (either custom or automatically generated) is retrieved and stored as the custom user identifier. This preserves visitor data between upgrades of the SDK. For new installations on the 4.x SDK, user identifier is null until set.
Enables or disables debug logging.
The user's current lifetime value.
The number of hits currently in the tracking queue.
The privacy status.
The visitor's profile.
A string containing the DPID value.
A string containing the DPUUID value.
One of the possible values of the privacyStatus
property.
One of the possible values of the privacyStatus
property.
One of the possible values of the privacyStatus
property.
Constant string that can be used as keys to add common target parameters.
Constant string that can be used as keys to add common target parameters.
Constant string that can be used as keys to add common target parameters.
Constant string that can be used as keys to add common target parameters.
Constant string that can be used as keys to add common target parameters.
Constant string that can be used as keys to add common target parameters.
Constant string that can be used as keys to add common target parameters.
Constant string that can be used as keys to add common target parameters.
Constant string that can be used as keys to add common target parameters.
See example.
Original: Jeff Haynie, Fred Spencer, & Jon Alter
Rewrite based on 4.x: Zsombor Papp
View the change log for this module.
Please direct all questions, feedback, and concerns to info@appcelerator.com.
Copyright(c) 2010-2015 by Appcelerator, Inc. All Rights Reserved. Please see the LICENSE file included in the distribution for further details.