PHPackages                             albafo/google-connector-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. albafo/google-connector-php

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

albafo/google-connector-php
===========================

Google OAuth2 API Connector

v0.1.3(5y ago)014MITPHPPHP ^7.3

Since Oct 2Pushed 5y ago1 watchersCompare

[ Source](https://github.com/albafo/google-connector-php)[ Packagist](https://packagist.org/packages/albafo/google-connector-php)[ RSS](/packages/albafo-google-connector-php/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (5)Dependencies (3)Versions (7)Used By (0)

Zeus Google Api Connector
=========================

[](#zeus-google-api-connector)

[![PHP version](https://camo.githubusercontent.com/ad72b1c53df3399123f38ecb4e05e764bab2ab38d741e18095b6f961417a11ce/68747470733a2f2f62616467652e667572792e696f2f70682f616c6261666f253246676f6f676c652d636f6e6e6563746f722d7068702e737667)](https://badge.fury.io/ph/albafo%2Fgoogle-connector-php) [![Build Status](https://camo.githubusercontent.com/06c5062ccb681d5d5ac42cac4fe4bf7f8c9ee215d64f4eda8690f6215770417d/68747470733a2f2f7472617669732d63692e6f72672f616c6261666f2f676f6f676c652d636f6e6e6563746f722d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/albafo/google-connector-php)

This project hosts the PHP Google Api Connector for the various Google APIs (Ads, YouTube, Metrics...)

Install
-------

[](#install)

### Using composer require

[](#using-composer-require)

The library will be downloaded by Composer and stored under the `vendor/` directory. **Examples are NOT downloaded by this download method.**

1. Install the latest version using [Composer](https://getcomposer.org/).

    ```
    $ composer require albafo/google-connector-php

    ```
2. Follow [Using OAuth 2.0 to Access Google APIs](https://developers.google.com/identity/protocols/oauth2) if you haven't set up the credentials yet.
3. You can now use the library.

AdsApi
------

[](#adsapi)

AdsApi allows us to access Google Ads reports through the [Google Ads Query Language.](https://developers.google.com/google-ads/api/docs/query/overview)

### Setting up your credentials

[](#setting-up-your-credentials)

1. Get a OAuth2 **Client ID** and **Secret** from Credentials section over your [Google Cloud Platform](https://console.cloud.google.com/apis/credentials)
2. Get a **Refresh Token** calling our refresh-token.php script from your root project directory, which will prompt you for your OAuth2 client ID and secret.

```
php vendor/bin/refresh-token.php
```

3. Get **Development Token** from your [Google Ads API Center](https://ads.google.com/aw/apicenter)
4. Get your **Customer ID** (account id which you are consulting) and your **Login Customer ID** (parent account id) from your Google Ads Console. [Find your Customer ID](https://support.google.com/google-ads/answer/1704344?hl=en)

> **Remove hyphens from your customerId and loginCustomerId:** xxx-XXX-xxx to xxxXXXxxx

### Basic Usage

[](#basic-usage)

To get a report with Google Ads Query Language create an instance of AdsApi with your config and send the query from the **searchStream** method:

```
use Zeus\GoogleConnector\Api\AdsApi;

$adsApi = AdsApi::fromConfig([
    'clientId' => $config['clientId'],
    'clientSecret' => $config['clientSecret'],
    'refreshToken' => $config['refreshToken'],
    'developerToken' => $config['developerToken'],
    'customerId' => $config['customerId'],
    'loginCustomerId' => $config['loginCustomerId']
]);

$reportObject = $adsApi->searchStream("
    SELECT  campaign.id, campaign.name,  campaign.status
    FROM campaign
    ORDER BY campaign.id
");
```

Learn all reports query options in [Google Developers Ads Api Page](https://developers.google.com/google-ads/api/docs/reporting/example)

Next modules soon...
--------------------

[](#next-modules-soon)

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

6

Last Release

2095d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/47e2d6cfe52dac72c903659ba4b43fbdc6280872fa6360f50cb6b424833ef658?d=identicon)[a.bano](/maintainers/a.bano)

---

Top Contributors

[![albafo](https://avatars.githubusercontent.com/u/9990087?v=4)](https://github.com/albafo "albafo (5 commits)")

---

Tags

phpapigoogleoauthconnector

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/albafo-google-connector-php/health.svg)

```
[![Health](https://phpackages.com/badges/albafo-google-connector-php/health.svg)](https://phpackages.com/packages/albafo-google-connector-php)
```

###  Alternatives

[bocharsky-bw/vkontakte-php-sdk

Vkontakte PHP SDK

3359.6k1](/packages/bocharsky-bw-vkontakte-php-sdk)[andalisolutions/oauth2-anaf

Anaf OAuth 2.0 support for the PHP League's OAuth 2.0 Client

196.6k](/packages/andalisolutions-oauth2-anaf)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
