-
Notifications
You must be signed in to change notification settings - Fork 1
/
google_analytics_reports.api.php
51 lines (47 loc) · 1.81 KB
/
google_analytics_reports.api.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/**
* @file
* Hooks provided by the google_analytics_reports module.
*/
/**
* @addtogroup hooks
* @{
*/
/**
* Allow modules to alter Google Analytics field data before saving in database.
*
* @param array $field
* An associative array containing:
* - id: Google Analytics field id without "ga:" at the beginning.
* - kind: collection type.
* - attributes: an associative array containing:
* - type: the type of field.
* - dataType: the type of data this field represents.
* - group: The dimensions/metrics group the column belongs to.
* - status: the status of the column.
* - uiName: the name/label of the field used in user interfaces (UI).
* - description: The full description of the field.
* - allowedInSegments: Indicates whether the column can be used in
* the segment query parameter.
* - calculation: this shows how the metric is calculated. Only available
* for calculated metrics.
* - minTemplateIndex: this is the minimum index for the field. Only
* available for templatized fields.
* - maxTemplateIndex: this is the maximum index for the field. Only
* available for templatized fields
* - premiumMinTemplateIndex: this is the minimum index for the field
* for premium properties. Only available for templatized fields.
* - premiumMaxTemplateIndex: this is the maximum index for the field
* for premium properties. Only available for templatized fields.
* - allowedInSegments: Indicates whether the field can be used in
* the segment query parameter.
*/
function hook_google_analytics_reports_field_import_alter(array &$field) {
// Change data type for Date field.
if ($field['id'] === 'date') {
$field['attributes']['dataType'] = 'date';
}
}
/**
* @} End of "addtogroup hooks".
*/