Skip to content

Commit bb63fa1

Browse files
committed
Update Readme For Informations
1 parent 65e816e commit bb63fa1

File tree

2 files changed

+47
-3
lines changed

2 files changed

+47
-3
lines changed

README.md

+47-3
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,28 @@ $Analytics = new Analytics();
2525
// or manual
2626
$Analytics = new Analytics([
2727
'view_id' => 21312312313,
28-
'service_credentials_json' => 'google_analytic_services.json'
28+
'service_credentials_json' => 'path/to/google_analytic_services.json'
2929
]);
3030

3131
echo '<pre>';
3232
var_dump($Analytics->Fetching()->fetchUserTypes(Period::days(7)));
3333
echo '</pre>';
3434

35-
3635
// Method
3736
$Analytics = new Analytics();
37+
// Fetch Users and New Users
3838
$Analytics->Fetching()->fetchUserTypes(Period::days(7));
39+
// Get Data Top Browser used visitor
3940
$Analytics->Fetching()->fetchTopBrowsers(Period::days(7));
41+
// Get Data Refferer Page
4042
$Analytics->Fetching()->fetchTopReferrers(Period::days(7));
43+
// Populer Pages
4144
$Analytics->Fetching()->fetchMostVisitedPages(Period::days(7));
45+
// Get Visitor and Pageviews
4246
$Analytics->Fetching()->fetchTotalVisitorsAndPageViews(Period::days(7));
4347
```
4448

45-
Output Array :
49+
Example Output Array :
4650
```array
4751
array(2) {
4852
[0]=>
@@ -62,5 +66,45 @@ array(2) {
6266
}
6367
```
6468

69+
```php
70+
// Custom Query
71+
$Analytics->Fetching()->performQuery($period, $metrix, $other = array());
72+
// Example
73+
$Analytics->Fetching()->performQuery(Period::days(7), 'ga:sessions', ['dimensions' => 'ga:country', 'sort' => '-ga:sessions'])->getRows();
74+
```
75+
76+
Example Output Raw Array :
77+
```
78+
array(30) {
79+
[0]=>
80+
array(2) {
81+
[0]=>
82+
string(9) "Indonesia"
83+
[1]=>
84+
string(4) "3534"
85+
}
86+
[1]=>
87+
array(2) {
88+
[0]=>
89+
string(11) "Afghanistan"
90+
[1]=>
91+
string(2) "96"
92+
}
93+
[2]=>
94+
array(2) {
95+
[0]=>
96+
string(13) "United States"
97+
[1]=>
98+
string(2) "88"
99+
}
100+
}
101+
```
102+
103+
Explore Query on this App [ga-dev-tools](https://ga-dev-tools.web.app/query-explorer/)
104+
105+
# Screenshot
106+
![Backend](https://raw.githubusercontent.com/reactmore/google-analytic-api-client/master/screenshot.png)
107+
108+
65109

66110

screenshoot.png

49.3 KB
Loading

0 commit comments

Comments
 (0)