function ga_push_ga_push_method in GA Push 8
Same name and namespace in other branches
- 7 ga_push.module \ga_push_ga_push_method()
Implements hook_ga_push_method().
File
- ./
ga_push.module, line 664 - Drupal Module: GA Push.
Code
function ga_push_ga_push_method() {
$module_path = drupal_get_path('module', 'ga_push');
$method[GA_PUSH_METHOD_ANALYTICS_JS] = [
'name' => 'Analytics.js (js)',
'description' => Link::fromTextAndUrl('Analytics.js', Url::fromUri('https://developers.google.com/analytics/devguides/collection/analyticsjs/'))
->toString(),
'machine_name' => GA_PUSH_METHOD_ANALYTICS_JS,
'callback' => 'ga_push_method_analytics_js',
'file' => $module_path . '/inc/ga_push.analytics_js.inc',
'implements' => [
GA_PUSH_TYPE_EVENT => TRUE,
GA_PUSH_TYPE_ECOMMERCE => TRUE,
GA_PUSH_TYPE_EXCEPTION => TRUE,
GA_PUSH_TYPE_PAGEVIEW => TRUE,
GA_PUSH_TYPE_SOCIAL => TRUE,
],
'side' => GA_PUSH_CLIENT_SIDE,
'tracking_method' => GA_PUSH_TRACKING_METHOD_UNIVERSAL,
'available' => TRUE,
];
$method[GA_PUSH_METHOD_UTMP_PHP] = [
'name' => 'Measurement Protocol (php)',
'description' => Link::fromTextAndUrl('Measurement Protocol', Url::fromUri('https://developers.google.com/analytics/devguides/collection/protocol/v1/'))
->toString(),
'machine_name' => GA_PUSH_METHOD_UTMP_PHP,
'callback' => 'ga_push_method_utmp_php',
'file' => $module_path . '/inc/ga_push.utmp.php.inc',
'implements' => [
GA_PUSH_TYPE_EVENT => TRUE,
GA_PUSH_TYPE_ECOMMERCE => TRUE,
GA_PUSH_TYPE_EXCEPTION => TRUE,
GA_PUSH_TYPE_PAGEVIEW => TRUE,
GA_PUSH_TYPE_SOCIAL => TRUE,
],
'side' => GA_PUSH_SERVER_SIDE,
'tracking_method' => GA_PUSH_TRACKING_METHOD_UNIVERSAL,
'available' => TRUE,
];
$method[GA_PUSH_METHOD_GA_JS] = [
'name' => 'Ga.js (js)',
'description' => '@deprecated ' . Link::fromTextAndUrl('ga.js', Url::fromUri('https://developers.google.com/analytics/devguides/collection/gajs/'))
->toString(),
// 'description' => Link::fromTextAndUrl('ga.js', Url::fromUri('https://developers.google.com/analytics/devguides/collection/gajs/')),
'machine_name' => GA_PUSH_METHOD_GA_JS,
'callback' => 'ga_push_method_ga_js',
'file' => $module_path . '/inc/ga_push.ga_js.inc',
'implements' => [
GA_PUSH_TYPE_EVENT => TRUE,
GA_PUSH_TYPE_ECOMMERCE => TRUE,
],
'side' => GA_PUSH_CLIENT_SIDE,
'tracking_method' => GA_PUSH_TRACKING_METHOD_CLASSIC,
'available' => TRUE,
];
$method[GA_PUSH_METHOD_PHP_GA] = [
'name' => 'PHP-GA (php)',
'description' => '@deprecated requires php 5.3 and php-ga library',
'machine_name' => GA_PUSH_METHOD_PHP_GA,
'callback' => 'ga_push_method_php_ga',
'file' => $module_path . '/inc/ga_push.php_ga.inc',
'implements' => [
GA_PUSH_TYPE_EVENT => TRUE,
GA_PUSH_TYPE_ECOMMERCE => TRUE,
],
'side' => GA_PUSH_SERVER_SIDE,
'tracking_method' => GA_PUSH_TRACKING_METHOD_CLASSIC,
'available' => 'ga_push_method_php_ga_available',
];
$method[GA_PUSH_METHOD_DATALAYER_JS] = [
'name' => 'Datalayer.js (js)',
'description' => Link::fromTextAndUrl('Data Layer', Url::fromUri('https://developers.google.com/tag-manager/devguide'))
->toString(),
'machine_name' => GA_PUSH_METHOD_DATALAYER_JS,
'callback' => 'ga_push_method_datalayer',
'file' => $module_path . '/inc/ga_push.datalayer.inc',
'implements' => [
GA_PUSH_TYPE_EVENT => TRUE,
],
'side' => GA_PUSH_CLIENT_SIDE,
'tracking_method' => GA_PUSH_TRACKING_METHOD_UNIVERSAL,
'available' => TRUE,
];
return $method;
}