-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
24 lines (19 loc) · 654 Bytes
/
index.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
<?php
setlocale(LC_TIME, 'pt_BR', 'pt_BR.utf-8', 'pt_BR.utf-8', 'portuguese');
date_default_timezone_set('America/Sao_Paulo');
require_once 'vendor/autoload.php';
use Google\Construct\BigQuery;
$date = date("Ymd", strtotime("-1 month"));
$bigQuery = new BigQuery();
/**
* Example query select analytics
*/
//$queryResults = $bigQuery->query(querySelectAnalytics() . " WHERE event_date > '$date' LIMIT 100");
//foreach (json_decode($queryResults) as $row) {
// echo $row->event_name . "<br>";
//}
/**
* Example query select analytics by last month
*/
$queryResults = $bigQuery->query(querySelectAnalyticsCount($date));
print_r($queryResults);