Center Command Queue

The center() function is an interface into a queue. Commands in the queue will be executed at some future point, once the main center object and required plugins have been loaded. This allows for you to interact with the Tracking Code before it has actually been loaded.

The Installation Snippet defines the initial center() command queue function.

NOTE The JavaScript Installation Snippet allows the center() function to be renamed. If you do this, ensure that any code references the new name.

Function signature  
center(command, [...fields], [commandOptions]) Invoking center() with a command signature will push commands into the queue to be executed once the library has loaded.
center(readyCallback) Invoking center() with a function will attach a ready callback to be executed once the library has loaded.
The readyCallback will be passed the center() function as its only argument.

Queuing commands

Invoking center() with a command signature will push commands into the queue to be executed once the library has loaded.

Usage

center(command, [...fields])

Parameters

Name Type Required Description
command string yes Identifier representing the center command to add to the queue. This can optionally include a property and plugin specification. This must be one of the commands defined in the center object.
…fields * no One or more parameters as required by the command.

Ready callback

Invoking center() with a function will attach a ready callback to be executed once the library has loaded.

The readyCallback will be passed the center() function as its only argument.

Usage

center(function(centerObj) {

});

Parameters

Name Type Required Description
readyCallback Function yes A callback function to be invoked when the Tracking Code is ready for interaction. The function is invoked with the activated center() function.