edbizarro/bi-connect

连接第三方数据源。


README

BI - Connect

通过连接第三方数据源来获取数据。

Build Status StyleCI Latest Stable Version License

支持的数据源

  • Google Analytics
  • Adobe Analytics(开发中)
  • Facebook Ads(开发中)
  • Instagram Ads(开发中)
  • Twitter(开发中)
  • TailTarget(开发中)

以下是一些如何使用此包的示例

use Bi\Connect\Google\GoogleConnect;
use Bi\Connect\Google\Auth\CredentialsFileAuth;

$googleConnect = new GoogleConnect(
    new CredentialsFileAuth('path/to/ga/credentials.json) // https://developers.google.com/analytics/devguides/reporting/core/v4/authorization#common_oauth_20_flows
);

$googleConnect->addScope('analytics');
$googleConnect->setRedirectUrl('registered callback url'); // Se link above
$googleConnect->getLoginUrl(); // Get google login auth url

// OAuth2 flow

在OAuth2流程之后,您可以访问GA Analytics API

// Retrieve all analytics accounts
$accounts = $googleConnect->analytics()->accounts();

安装

您可以通过composer安装此包

composer require edbizarro/bi-connect

forthebadge

FOSSA Status