You are here

function datalayer_preprocess_page in dataLayer 7

Implements hook_preprocess_HOOK().

Add data for output.

File

./datalayer.module, line 57
Client-side data space.

Code

function datalayer_preprocess_page(&$variables) {
  global $user;

  // Add details about the page entity.
  if (variable_get('datalayer_add_page_meta', TRUE)) {
    datalayer_add(datalayer_get_page_data());
  }
  if (variable_get('datalayer_expose_user_details')) {
    datalayer_add(datalayer_get_user_data());
  }

  // Always output active uid.
  datalayer_add(array(
    'userUid' => $user->uid,
  ));
}