function ga_push_method_utmp_php in GA Push 8
Same name and namespace in other branches
- 7 inc/ga_push.utmp.php.inc \ga_push_method_utmp_php()
GA Push Method callback: UTMP (php).
1 string reference to 'ga_push_method_utmp_php'
- ga_push_ga_push_method in ./
ga_push.module - Implements hook_ga_push_method().
File
- inc/
ga_push.utmp.php.inc, line 19 - UTMP: method and functions for Universal Tracking Measure Protocol.
Code
function ga_push_method_utmp_php($push, $type, $options) {
switch ($type) {
case GA_PUSH_TYPE_EVENT:
$event_data = ga_push_method_php_utmp_construct_event_request_data($push);
// @TODO: Check response.
ga_push_method_utmp_php_request($event_data, $options);
break;
case GA_PUSH_TYPE_ECOMMERCE:
if (isset($push['trans']) && isset($push['items']) && count($push['items'])) {
// Construct arrays.
$ecommerce_data = ga_push_method_utmp_php_construct_ecommerce_request_data($push);
// Sending the transaction:
// @TODO: Check request response.
ga_push_method_utmp_php_request($ecommerce_data['transaction'], $options);
// Sending the items:
foreach ($ecommerce_data['items'] as $item_data) {
ga_push_method_utmp_php_request($item_data, $options);
}
}
break;
case GA_PUSH_TYPE_EXCEPTION:
$exception_data = ga_push_method_php_utmp_construct_exception_request_data($push);
// @TODO: Check response.
ga_push_method_utmp_php_request($exception_data, $options);
break;
case GA_PUSH_TYPE_PAGEVIEW:
$pageview_data = ga_push_method_php_utmp_construct_pageview_request_data($push);
// @TODO: Check response.
ga_push_method_utmp_php_request($pageview_data, $options);
break;
case GA_PUSH_TYPE_SOCIAL:
$social_data = ga_push_method_php_utmp_construct_social_request_data($push);
// @TODO: Check response.
ga_push_method_utmp_php_request($social_data, $options);
break;
}
}