This plugin provides the means to tag Titanium applications for the purposes of leveraging Tealium's tag management platform (Tealium IQ).
Tealium's mobile solution permits an app to add, remove or edit analytic services remotely, in real-time, without requiring a code rebuild or new release to take effect.
If you wish to use Titanium Classic, see this quick start guide instead.
- Titanium 3+
This guide presumes you have already created an Alloy app using it's development studio. Follow the below steps to add Tealium's Plugin to it.
####1. Clone/Copy Library#### onto your dev machine by clicking on the Clone to Desktop or Download ZIP buttons on the main repo page.
####2. Add To Project
2a. Copy the "tealium" directory into the "<project-root>/app/assets/" directory.
2b. In your project's "/app/alloy.js" file, import the Tealium Library using:
Titanium.include(‘Tealium/tealium.js'); 2c. In the entry controller of your application (most likely "/app/controller/index.js") add the following line to initialize:
Tealium.initialize({
window : $.index, /* your first window */
account : "tealiummobile",
profile : "demo",
environment : "dev",/* dev, qa, or prod */
disableHTTPS : false, /* OPTIONAL; Default is false. */
suppressLogs : true, /* OPTIONAL; Default is true. */
suppressErrors : false, /* OPTIONAL; Default is false. */
disableLifeCycleTracking : false /* OPTIONAL; Default is false. */
}); 2d. (OPTIONAL) If you want lifecycle tracking be sure to add the following code to every window your app uses:
$.index.addEventListener('focus', function() {
Tealium.onFocus();
});
$.index.addEventListener('blur', function() {
Tealium.onBlur();
});NOTE: If Tealium.onFocus() isn't called within 10 seconds of Tealium.onBlur() being called: the app will be considered to be asleep.
2e. (OPTIONAL) It is also highly recommended you add "Tealium.trackViewEvent(...)" into the "focus" transforming the $.index.addEventListener('focus', ...) to capture view events:
$.index.addEventListener('focus', function() {
Tealium.trackViewEvent('root-screen');
Tealium.onFocus();
}); 2f. When tagging controls, you should use the Tealium.trackControlEvent(...) method.
function onClick(e) {
Tealium.trackControlEvent('button:click');
/* click logic */
}####3. Run
Congratulations! You have successfully implemented the Tealium Plugin into your project. The following should be visible in the console:
You can use an HTTP proxy to confirm successful retrieval of configuration data from our multi-CDN and to confirm successful delivery of a tracking call. Several popular third-party options are:
Tealium's multi-CDN configuration address is http://tags.tiqcdn.com. You may have to use the disable HTTPS Config option when you init the library to permit proxying.
If you have access to the Tealium Community site, detailed instructions on how to setup Charles Proxy on an iDevice can be found at: https://community.tealiumiq.com/posts/624994
Alternatively, you can use an analytic service with real-time reporting to confirm delivery of dispatches. This verification method requires both an active analytics account (i.e. Google Analytics) and an active Tealium IQ account to enable mapping. If you have both of these, consult the Tealium community post at: https://community.tealiumiq.com/posts/568700
Questions or comments?
- Post code questions in the issues page.
- Contact your Tealium account manager
Copyright (C) 2012-2015, Tealium Inc.


