You are here

function _ga_push_method_datalayer_js_push_event_script in GA Push 7

Same name and namespace in other branches
  1. 8 inc/ga_push.datalayer.inc \_ga_push_method_datalayer_js_push_event_script()

Generates the ga JS code for pushing an event to GA.

Parameters

array $push: Event data.

Return value

string JS code with push code.

1 call to _ga_push_method_datalayer_js_push_event_script()
ga_push_method_datalayer_js_push_script in inc/ga_push.datalayer.inc
Generate the GA Push script code by type.

File

inc/ga_push.datalayer.inc, line 74
Universal Datalayer js: method and functions.

Code

function _ga_push_method_datalayer_js_push_event_script($push) {

  // Optional: default values.
  $push += array(
    'event' => '',
  );

  // Convert to JS function.
  $script = _ga_push_method_datalayer_js_push_send_script($push);
  return $script;
}