Skip to content

edbizarro/bi-connect

Repository files navigation

BI - Connect

Connect with 3rd party sources to get data.

Build Status StyleCI Latest Stable Version License

Supported sources:

  • Google Analytics
  • Adobe Analytics (WIP)
  • Facebook Ads (WIP)
  • Instagram Ads (WIP)
  • Twitter (WIP)
  • TailTarget (WIP)

Here are a few examples on how you can use the package:

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

After the OAuth2 flow you can access GA Analytics API

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

Installation

You can install the package via composer:

composer require edbizarro/bi-connect

forthebadge

FOSSA Status