哪种方法最适合将Google Analytics数据导出到我的自定义信息中心

时间:2021-10-09 15:14:14

I want to create my custom dashboard for my site where i show all the google analytics data in custom view. but i'm very confused about google api. i'm using symfony framework to create this dashboard. so, which code api is most popular and sufficient for me. pleaqse suggest me.

我想为我的网站创建自定义信息中心,我会在自定义视图中显示所有Google Analytics数据。但我对google api非常困惑。我正在使用symfony框架来创建此仪表板。所以,哪种代码api对我来说最受欢迎。请求建议我。

2 个解决方案

#1


2  

If using Symfony - use the PHP API.

如果使用Symfony - 请使用PHP API。

Google Analytics Date Export has a list of client libraries here : http://code.google.com/apis/analytics/docs/gdata/gdataLibraries.html

Google Analytics日期导出在此处有一个客户端库列表:http://code.google.com/apis/analytics/docs/gdata/gdataLibraries.html

PHP is shown at the bottom.

PHP显示在底部。

#2


1  

I recommend that you use Zend_Gdata_Analytics, it has a cleaner api than GAPI class referenced on gdata libraries page. I've actually wrapped this class around my own to write specific analytic methods like this:

我建议您使用Zend_Gdata_Analytics,它具有比gdata库页面上引用的GAPI类更清晰的API。我实际上已经将这个类包装在我自己的周围来编写这样的特定分析方法:

  public function getVisitsByDate()
  {
    $query = $this->createQuery() 
      ->addDimension('ga:date')  
      ->addMetric('ga:visits')
      ->setSort('ga:date')
    ;
    return $this->getDataFeed($query);
  }

Then I would serialize the results and visualize with Hicharts.js library, but it's really up to you what library to use.

然后我将序列化结果并使用Hicharts.js库进行可视化,但这取决于您使用的库。

#1


2  

If using Symfony - use the PHP API.

如果使用Symfony - 请使用PHP API。

Google Analytics Date Export has a list of client libraries here : http://code.google.com/apis/analytics/docs/gdata/gdataLibraries.html

Google Analytics日期导出在此处有一个客户端库列表:http://code.google.com/apis/analytics/docs/gdata/gdataLibraries.html

PHP is shown at the bottom.

PHP显示在底部。

#2


1  

I recommend that you use Zend_Gdata_Analytics, it has a cleaner api than GAPI class referenced on gdata libraries page. I've actually wrapped this class around my own to write specific analytic methods like this:

我建议您使用Zend_Gdata_Analytics,它具有比gdata库页面上引用的GAPI类更清晰的API。我实际上已经将这个类包装在我自己的周围来编写这样的特定分析方法:

  public function getVisitsByDate()
  {
    $query = $this->createQuery() 
      ->addDimension('ga:date')  
      ->addMetric('ga:visits')
      ->setSort('ga:date')
    ;
    return $this->getDataFeed($query);
  }

Then I would serialize the results and visualize with Hicharts.js library, but it's really up to you what library to use.

然后我将序列化结果并使用Hicharts.js库进行可视化,但这取决于您使用的库。