google_analytics_et_example.module in Google Analytics Event Tracking 6
Same filename and directory in other branches
Google Analytics Event Tracking Module API Example.
Shows a quick and dirty example of how to integrate the Google Analytics Event Tracking Module into an user's module.
File
google_analytics_et_example/google_analytics_et_example.moduleView source
<?php
/**
* @file
* Google Analytics Event Tracking Module API Example.
*
* Shows a quick and dirty example of how to integrate the Google Analytics
* Event Tracking Module into an user's module.
*/
/**
* Implements hook_google_analytics_et_api().
*/
function google_analytics_et_example_google_analytics_et_api() {
return _google_analytics_et_example_set_selectors_array();
}
/**
* Internal function returns the example selectors array.
*/
function _google_analytics_et_example_set_selectors_array() {
$selectors = array();
$selectors = array(
array(
'event' => 'mousedown',
'selector' => '#main-menu li a',
'category' => 'main navigation',
'action' => 'click',
'label' => '!text',
'value' => 0,
'noninteraction' => TRUE,
),
array(
'event' => 'mousedown',
'selector' => 'div',
'category' => 'main navigation',
'action' => 'click',
'label' => '!test',
'value' => 0,
'noninteraction' => TRUE,
),
array(
'event' => 'mousedown',
'selector' => 'a#logo',
'category' => 'Home Link',
'action' => 'click',
'label' => 'Logo',
'value' => 0,
'noninteraction' => TRUE,
),
array(
'event' => 'mousedown',
'selector' => 'div#site-name a[rel="home"]',
'category' => 'Home Link',
'action' => 'click',
'label' => 'Site Name',
'value' => 0,
'noninteraction' => TRUE,
),
array(
'event' => 'blur',
'selector' => '#edit-name',
'category' => 'test',
'action' => 'click',
'label' => '!test',
'value' => 0,
'noninteraction' => TRUE,
),
);
return $selectors;
}
Functions
Name | Description |
---|---|
google_analytics_et_example_google_analytics_et_api | Implements hook_google_analytics_et_api(). |
_google_analytics_et_example_set_selectors_array | Internal function returns the example selectors array. |