forked from lordcoste/analytics-s2s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAnalytics.php
58 lines (47 loc) · 1.09 KB
/
Analytics.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
52
53
54
55
56
57
58
<?php
class Analytics {
private static $analytics = NULL;
public static function init($analytics)
{
if(is_null(self::$analytics)) self::$analytics = $analytics;
}
public static function query($id, $start_date, $end_date, $metrics, $others = array())
{
return self::$analytics->data_ga->get($id, $start_date, $end_date, $metrics, $others);
}
public static function segments()
{
return self::$analytics->management_segments;
}
public static function accounts()
{
return self::$analytics->management_accounts;
}
public static function goals()
{
return self::$analytics->management_goals;
}
public static function profiles()
{
return self::$analytics->management_profiles;
}
public static function webproperties()
{
return self::$analytics->management_webproperties;
}
/**
* @return String ga:xxxxxxx
*/
public static function getAllSitesIds()
{
return self::$analytics->getAllSitesIds();
}
/**
* @param $url String
* @return array(array('url' => 'id'))
*/
public static function getSiteIdByUrl($url)
{
return self::$analytics->getSiteIdByUrl($url);
}
}