Turbine Free Variable
turbine object is a “free variable” within the scope of your extension’s library modules. It provides information and utilities specific to the Launch runtime and is always available to library modules without using
turbine.buildInfo: Object<string, string>
An object containing information about the build of the current Launch runtime library. The object will contain the following values:
The Turbine version used inside the current library.
The ISO 8601 date when the version of Turbine used inside the container was built.
The ISO 8601 date when the current library was built.
The environment for which this library was built. The possible values are: ‘development’, ‘staging’, ‘production.’
This is an example demonstrating the object values.
turbine.getDataElementValue(name: string) => *
Returns the value of a data element.
turbine.getExtensionSettings() => *
var extensionSettings = turbine.getExtensionSettings();
Returns the settings object that was last saved from the extension configuration view.
Please note that values within the returned settings objects may be coming from data elements. Because of this, calling
getExtensionSettings() at different times may yield different results if the values of the data elements have changed. To get the most up-to-date values, please wait until as late as possible before calling
turbine.getHostedLibFileUrl(file: string) => string
var loadScript = require('@adobe/reactor-load-script');
// Do something ...
The hostedLibFiles property can be defined inside the extension manifest in order to host various files along with the Launch runtime library. This module returns the URL where the given library file is hosted.
turbine.getSharedModule(extensionName: string, sharedModuleName: string) => *
var mcidInstance = turbine.getSharedModule('adobe-mcid', 'mcid-instance');
Retrieves a module which has been shared from another extension. If no matching module is found,
undefined will be returned. See Implementing Shared Modules for more information regarding shared modules.
turbine.logger: Object<string, Function>
Logging utility used to log messages to the console. Messages will only show in the console if debugging is turned on by the user. The recommended way to turn on debugging is to use the Adobe DTM Switch Chrome extension. As an alternative, the user can run the following command
_satellite.setDebug(true) inside the browser development console. The logger has the following methods:
Logs a message to the console.
Logs an informational message to the console.
Logs a warning message to the console.
Logs an error message to the console.
We recommend not using this utility if possible. As more consumers move toward loading Launch asynchronously, the concept of “page bottom” becomes less relevant.
// This will be executed at page bottom.
callback argument will be executed when the
_satellite.pageBottom() method is called.
satellite.pageBottom() is typically called by the host site just before the end of the
body tag; however, a host site may choose to load the Launch library asynchronously, in which case they will not call
_satellite won’t exist until after page bottom). If the
load event is fired by the browser and
_satellite.pageBottom() has not yet been called,
_satellite.pageBottom() will automatically be called by Launch. While it might make sense for
_satellite.pageBottom() to be called automatically after
DOMContentLoaded instead of
load, there are issues in IE10 that prevent Launch from doing so.
An object containing the following settings which are defined by the user for the property of the current Launch runtime library:
An array of domains that the Launch property covers.
In the European Union, websites are required to allow users to opt out of tracking. When a user on a website opts out of being tracked, the website will need to set a cookie whose name is the value of
trackingCookieName. The website will set the cookie’s value to
"false" if the user has opted out of tracking and
"true" otherwise. If your extension is capable of tracking a user and needs to support user opt-out, it should check that the value of the cookie is
"true" before tracking the user.
When a user clicks a link, the browser can often navigate to the new location before rules attached to the click event are able to fully execute. This can be problematic if, for example, a rule is supposed to send a beacon to a server when a user clicks a link. By delaying the navigation for a period of time, it can give the rule sufficient time to execute before the user is navigated to the new location.
If your extension exposes an event type that is based on a user clicking an element, it’s advisable that you check to see whether the element clicked is a link and, if so, delay the navigation for the number of milliseconds defined by
Extension developers should not be concerned with this setting.