You are here

function ga_push_ga_push_method in GA Push 7

Same name and namespace in other branches
  1. 8 ga_push.module \ga_push_ga_push_method()

Implements hook_ga_push_method().

File

./ga_push.module, line 659
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] = array(
    'name' => 'Analytics.js (js)',
    'description' => l('Analytics.js', 'https://developers.google.com/analytics/devguides/collection/analyticsjs/'),
    'machine_name' => GA_PUSH_METHOD_ANALYTICS_JS,
    'callback' => 'ga_push_method_analytics_js',
    'file' => $module_path . '/inc/ga_push.analytics_js.inc',
    'implements' => array(
      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] = array(
    'name' => 'Measurement Protocol (php)',
    'description' => l('Measurement Protocol', 'https://developers.google.com/analytics/devguides/collection/protocol/v1/'),
    'machine_name' => GA_PUSH_METHOD_UTMP_PHP,
    'callback' => 'ga_push_method_utmp_php',
    'file' => $module_path . '/inc/ga_push.utmp.php.inc',
    'implements' => array(
      GA_PUSH_TYPE_EVENT => TRUE,
      GA_PUSH_TYPE_ECOMMERCE => TRUE,
      GA_PUSH_TYPE_ENHANCED_ECOMMERCE_PURCHASE => 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] = array(
    'name' => 'Ga.js (js)',
    'description' => '@deprecated ' . l('ga.js', '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' => array(
      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] = array(
    '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' => array(
      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_SSGA] = array(
    'name' => 'SSGA (php)',
    'description' => '@deprecated requires php 5.2+, curl and ssga libraries',
    'machine_name' => GA_PUSH_METHOD_SSGA,
    'callback' => 'ga_push_method_ssga',
    'file' => $module_path . '/inc/ga_push.ssga.inc',
    'implements' => array(
      GA_PUSH_TYPE_EVENT => TRUE,
    ),
    'side' => GA_PUSH_SERVER_SIDE,
    'tracking_method' => GA_PUSH_TRACKING_METHOD_CLASSIC,
    'available' => class_exists('ssga') && is_callable('curl_init'),
  );
  $method[GA_PUSH_METHOD_DATALAYER_JS] = array(
    'name' => 'Datalayer.js (js)',
    'description' => l('Data Layer', 'https://developers.google.com/tag-manager/devguide'),
    'machine_name' => GA_PUSH_METHOD_DATALAYER_JS,
    'callback' => 'ga_push_method_datalayer',
    'file' => $module_path . '/inc/ga_push.datalayer.inc',
    'implements' => array(
      GA_PUSH_TYPE_EVENT => TRUE,
    ),
    'side' => GA_PUSH_CLIENT_SIDE,
    'tracking_method' => GA_PUSH_TRACKING_METHOD_UNIVERSAL,
    'available' => TRUE,
  );
  return $method;
}