function _ga_push_method_analytics_js_push_event_script in GA Push 7
Same name and namespace in other branches
- 8 inc/ga_push.analytics_js.inc \_ga_push_method_analytics_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_analytics_js_push_event_script()
- ga_push_method_analytics_js_push_script in inc/
ga_push.analytics_js.inc - Generate the GA Push script code by type.
File
- inc/
ga_push.analytics_js.inc, line 98 - Universal Analytics js: method and functions.
Code
function _ga_push_method_analytics_js_push_event_script($push) {
// Optional: default values.
$push += array(
'eventLabel' => '',
'eventValue' => 1,
);
// Convert to JS function.
$script = _ga_push_method_analytics_js_push_send_script($push, 'event');
return $script;
}