|
@@ -23,7 +23,7 @@ class GA{
|
|
|
private function getViewId($dp){
|
|
|
return "155703065";
|
|
|
}
|
|
|
- public function contentpages($dp){
|
|
|
+ public function contentpages($dp,$start_at,$end_at){
|
|
|
$analytics=self::getInstance($dp);
|
|
|
$metricArr=[
|
|
|
'pageviews'=>"ga:pageviews",
|
|
@@ -40,8 +40,6 @@ class GA{
|
|
|
];
|
|
|
$VIEW_ID = $this->getViewId($dp);//
|
|
|
$dateRange = new \Google_Service_AnalyticsReporting_DateRange();
|
|
|
- $start_at=date('Y-m-d',time()-24*3600);
|
|
|
- $end_at=date('Y-m-d',time()-24*3600);
|
|
|
$dateRange->setStartDate($start_at);
|
|
|
$dateRange->setEndDate($end_at);
|
|
|
$metrics=[];
|
|
@@ -64,7 +62,7 @@ class GA{
|
|
|
$pageviewsFilter->setOperator("GREATER_THAN");
|
|
|
$pageviewsFilter->setComparisonValue("1");
|
|
|
|
|
|
- $MetricFilterClause=new \Google_Service_AnalyticsReporting_MetricFilterClause();
|
|
|
+ $MetricFilterClause=new \Google_Service_AnalyticsReporting_MetricFilterClause();
|
|
|
$MetricFilterClause->setFilters(array($pageviewsFilter));
|
|
|
|
|
|
|
|
@@ -134,7 +132,7 @@ class GA{
|
|
|
return $result;
|
|
|
|
|
|
}
|
|
|
- public function trafficsource(){
|
|
|
+ public function trafficsource($dp,$start_at,$end_at){
|
|
|
$analytics=self::getInstance($dp);
|
|
|
$metricArr=[
|
|
|
'users'=>"ga:users",
|
|
@@ -157,8 +155,6 @@ class GA{
|
|
|
];
|
|
|
$VIEW_ID = $this->getViewId($dp);//
|
|
|
$dateRange = new \Google_Service_AnalyticsReporting_DateRange();
|
|
|
- $start_at=date('Y-m-d',time()-24*3600);
|
|
|
- $end_at=date('Y-m-d',time()-24*3600);
|
|
|
$dateRange->setStartDate($start_at);
|
|
|
$dateRange->setEndDate($end_at);
|
|
|
$metrics=[];
|