PHPackages                             yatskanich/google-ads-php84 - 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. yatskanich/google-ads-php84

ActiveLibrary

yatskanich/google-ads-php84
===========================

Google Ads API client for PHP 8.4 support

v28.0.0.1(9mo ago)014↓100%Apache-2.0PHPPHP &gt;=8.4

Since Jun 12Pushed 9mo agoCompare

[ Source](https://github.com/yatskanich/google-ads-php84)[ Packagist](https://packagist.org/packages/yatskanich/google-ads-php84)[ Docs](https://github.com/googleads/google-ads-php)[ RSS](/packages/yatskanich-google-ads-php84/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (10)Versions (3)Used By (0)

Google Ads API Client Library for PHP
=====================================

[](#google-ads-api-client-library-for-php)

[![Minimum PHP Version](https://camo.githubusercontent.com/183804d09fec16ca7b6209b007250b7d8db1b915042feb093a9f20e6e1f25359/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e312d3838393242462e737667)](https://www.php.net/supported-versions.php)[![Latest Stable Version](https://camo.githubusercontent.com/7162410daa2effad449541c56d43a890ae364a1df36db9e4a48d527b78782e3a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f676f6f676c656164732f676f6f676c652d6164732d7068702e737667)](https://packagist.org/packages/googleads/google-ads-php)[![Total Downloads](https://camo.githubusercontent.com/906c10d95b9d85dd7c285931f060287a9f86203035b532ab7c970604e2b58cfd/68747470733a2f2f706f7365722e707567782e6f72672f676f6f676c656164732f676f6f676c652d6164732d7068702f646f776e6c6f6164732e737667)](https://packagist.org/packages/googleads/google-ads-php)[![License](https://camo.githubusercontent.com/31e91c4fc86606e73d5d6780ce24b35ffa958eac3825553459c2a47d397ead4a/68747470733a2f2f706f7365722e707567782e6f72672f676f6f676c656164732f676f6f676c652d6164732d7068702f6c6963656e73652e737667)](https://packagist.org/packages/googleads/google-ads-php)[![codecov](https://camo.githubusercontent.com/87c90c569a40134a12b6d8cc1e1870731d74de6e08cf5fb402c659fb0285084f/68747470733a2f2f636f6465636f762e696f2f67682f676f6f676c656164732f676f6f676c652d6164732d7068702f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/googleads/google-ads-php)

This project hosts the PHP client library for the [Google Ads API](https://developers.google.com/google-ads/api/docs/start). It adheres to the PHP sunset schedule and updates the composer.json file *four* to *five* months after the minimum required PHP version reaches its end-of-life. Based on the existing supported PHP versions, the update occurs about once a year.

**IMPORTANT** The Google Ads API client library for PHP has been updated to require PHP version 8 as the minimum version, as announced in [\#880](https://github.com/googleads/google-ads-php/issues/880). This means that the final version of the library that supports PHP 7 is [v19.2.0](https://github.com/googleads/google-ads-php/releases/tag/v19.2.0), which supports Google Ads API v12 to v14.

Google Ads API v14 is [scheduled to be sunset by the end of May 2024](https://developers.google.com/google-ads/api/docs/sunset-dates#timetable). Therefore, PHP 7 users have about *11 months* to migrate to PHP 8 in order to continue using the library without disruption.

Features
--------

[](#features)

- Distributed via [Composer](https://getcomposer.org/) and [Packagist](https://packagist.org/packages/googleads/google-ads-php).
- Easy management of credentials.
- Easy creation of Google Ads API service clients.

Requirements
------------

[](#requirements)

- Both 32-bit and 64-bit PHP systems are supported but we highly recommend to use 64-bit if you can. This is because many fields of the Google Ads API are typed as 64-bit integers and casting their values to `int` instead of `float` from 32-bit systems can lead to issues. The largest integer value supported in 32-bit PHP systems is usually 2147483647, see the predefined constant [PHP\_INT\_MAX](https://www.php.net/manual/en/reserved.constants.php) for more details.
- This library depends on [Composer](https://getcomposer.org/). If you don't have it installed on your computer yet, follow the [installation guide for Linux/Unix/OS X](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx) or [installation guide for Windows](https://getcomposer.org/doc/00-intro.md#installation-windows). For the rest of this guide, we're assuming that you're using Linux/Unix/OS X and have Composer installed [globally](https://getcomposer.org/doc/00-intro.md#globally), thus, your installed Composer is available on the command line as `composer`.
- System requirements and dependencies can be found in [composer.json](composer.json) of this library.
    - **PHP**: You can find the required minimum PHP version in `"php"` under the [**`require`**](https://getcomposer.org/doc/01-basic-usage.md#the-require-key) key of [`composer.json`](composer.json). We usually set it to the minimum PHP version for which the PHP development team still provide security fixes. Whenever such a version is sunset, we'll update the composer file accordingly. Currently, the update frequency is around once a year based on the [official schedule](https://www.php.net/supported-versions.php). Visit [this page](https://www.php.net/manual/en/getting-started.php) for introduction to PHP.
    - **gRPC**: To install the gRPC PHP extension, make sure to meet any additional requirements listed in the project's [**documentation**](https://cloud.google.com/php/grpc#installing_the_grpc_extension). You can learn more about how gRPC is used by this library by reading our [Transport](https://developers.google.com/google-ads/api/docs/client-libs/php/transport) guide. It usually take minutes to install using `PECL`:
        1. Install the extension using the command `sudo pecl install grpc`.
        2. Add a line `extension=grpc.so` to the `php.ini` file.
        3. Run `php -i | grep grpc` in a terminal: it is well installed and configured if it returns something
    - **Protobuf**: To install the Protobuf PHP extension, make sure to meet any additional requirements listed in the project's [**documentation**](https://github.com/protocolbuffers/protobuf/tree/HEAD/php#requirements). If you encounter any error during the installation, you can skip this step and the PHP implementation will be used instead. You can learn more about how Protobuf is used by this library by reading our [Protobuf implementations](https://developers.google.com/google-ads/api/docs/client-libs/php/protobuf) guide. It usually take minutes to install using `PECL`:
        1. Install the extension using the command `sudo pecl install protobuf`.
        2. Add a line `extension=protobuf.so` to the `php.ini` file.
        3. Run `php -i | grep protobuf` in a terminal: it is well installed and configured if it returns something
- You need a [developer token](https://developers.google.com/google-ads/api/docs/first-call/dev-token)to connect to the Google Ads API.
- One version of the library typically supports multiple versions of the Google Ads API. You can check the [CHANGELOG.md](https://github.com/googleads/google-ads-php/blob/HEAD/CHANGELOG.md) file to identify what versions of the library added or removed the support for a specific version of the Google Ads API. For example, the version `V7` of the Google Ads API was added in the version `v9.0.0` of the library as described [here](https://github.com/googleads/google-ads-php/blob/HEAD/CHANGELOG.md#900).

Getting started
---------------

[](#getting-started)

### Running code examples

[](#running-code-examples)

Follow the below steps if you want to try our code examples.

1. Clone this project in the directory of your choice via:

    ```
    git clone https://github.com/googleads/google-ads-php.git

    ```
2. Change into the `google-ads-php` directory.

    ```
    cd google-ads-php

    ```

    You'll see some files and subdirectories:

    - `composer.json`: the composer file, which holds the requirements of this library.
    - `src`: source code of the library.
    - `tests`: tests of the library code.
    - `examples`: many examples that demonstrate how to use the library to execute common use cases via the Google Ads API.
    - `metadata`: some metadata files used internally by the source code. They're automatically generated files, so you shouldn't modify them.
3. Run `composer install` at the command prompt. This will install all dependencies needed for using the library and running examples.
4. Set up your OAuth2 credentials.

    The Google Ads API uses [OAuth2](http://oauth.net/2/) as the authentication mechanism. Choose the appropriate option below based on your use case, and read and follow the instructions that the example prints to the console.

    - Copy the sample [`google_ads_php.ini`](examples/Authentication/google_ads_php.ini)to your [home directory](https://en.wikipedia.org/wiki/Home_directory#Default_home_directory_per_operating_system). This library determines the home directory of your computer by using [`EnvironmentalVariables::getHome()`](https://github.com/googleads/google-ads-php/blob/HEAD/src/Google/Ads/GoogleAds/Util/EnvironmentalVariables.php#L36).
    - Follow the instructions at  to create an OAuth2 client ID and secret for the **installed application**OAuth2 flow.
    - Run the [GenerateUserCredentials](https://github.com/googleads/google-ads-php/blob/HEAD/examples/Authentication/GenerateUserCredentials.php)example, which will prompt you for your OAuth2 client ID and secret.
    - Copy the output from the last step of the example into the `google_ads_php.ini` file in your home directory. Don't forget to fill in your developer token too.
5. Run the [GetCampaigns example](examples/BasicOperations/GetCampaigns.php) to test if your credentials are valid. You also need to pass your Google Ads account's customer ID without dashes as a command-line parameter:

    ```
    php examples/BasicOperations/GetCampaigns.php --customerId

    ```

    **NOTE**: Code examples are meant to be run from command prompt, not via the web browsers.
6. Explore other examples.

    The [examples](examples) directory contains several useful examples. Most of the examples require parameters. You can see what are required by running code examples with `--help` as a command-line parameter.

    **Note:** You will find comments with the formats `[START...]` and `[END...]`in the source code of these examples. These are only used for technical purposes, you can completely disregard them.

### Installing the library as your project's dependency

[](#installing-the-library-as-your-projects-dependency)

1. Change into the root directory of your project.
2. Run `composer require googleads/google-ads-php` at the command prompt. This will install this library and all its dependencies in the `vendor/`directory of your project's root directory.
3. **Set up your OAuth2 credentials** like described in the previous section.
4. You can now use this library by importing its classes like shown in the [code examples](examples/).

Basic usage
-----------

[](#basic-usage)

### Instantiate a client

[](#instantiate-a-client)

To issue requests via the Google Ads API, you first need to create a [GoogleAdsClient](https://github.com/googleads/google-ads-php/blob/HEAD/src/Google/Ads/GoogleAds/Lib/V20/GoogleAdsClient.php).

For more information on how to configure a client when instantiating it, see the [configuration guide](https://developers.google.com/google-ads/api/docs/client-libs/php/configuration).

### Get a service client

[](#get-a-service-client)

Once you have an instance of `GoogleAdsClient`, you can obtain a service client for a particular service using one of the `get...ServiceClient()` methods.

Client configuration
--------------------

[](#client-configuration)

See the [Configuration guide](https://developers.google.com/google-ads/api/docs/client-libs/php/configuration).

Transport
---------

[](#transport)

There are different types of transport that can be used. See the [Transport guide](https://developers.google.com/google-ads/api/docs/client-libs/php/transport)for more information.

Protobuf
--------

[](#protobuf)

[Protobuf](https://developers.google.com/protocol-buffers/docs/overview) is used regardless of the transport used to request the Google Ads API.

See the [Protobuf guide](https://developers.google.com/google-ads/api/docs/client-libs/php/protobuf)for more information.

Running in a Docker container
-----------------------------

[](#running-in-a-docker-container)

See the [Running in a Docker container guide](https://developers.google.com/google-ads/api/docs/client-libs/php/docker).

Logging
-------

[](#logging)

See the [Logging guide](https://developers.google.com/google-ads/api/docs/client-libs/php/logging).

Proxy configuration
-------------------

[](#proxy-configuration)

See the [Proxy guide](https://developers.google.com/google-ads/api/docs/client-libs/php/proxy).

Performance
-----------

[](#performance)

See the [Performance guide](https://developers.google.com/google-ads/api/docs/client-libs/php/performance).

Miscellaneous
-------------

[](#miscellaneous)

### Wiki

[](#wiki)

-

### Issue tracker

[](#issue-tracker)

-

### API Documentation:

[](#api-documentation)

-

### Support forum

[](#support-forum)

-

### Authors

[](#authors)

- [Thanet Knack Praneenararat](https://github.com/fiboknacky)
- [Mattia Tommasone](https://github.com/Raibaz)

###  Health Score

35

—

LowBetter than 81% of packages

Maintenance57

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 52% 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 ~0 days

Total

2

Last Release

282d ago

Major Versions

v0.0.1 → v28.0.0.12025-06-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/39c885da230d32026f0391f73fc8940ea94d8adb924e2344f2239a15147f195c?d=identicon)[yatskanych](/maintainers/yatskanych)

---

Top Contributors

[![fiboknacky](https://avatars.githubusercontent.com/u/1702801?v=4)](https://github.com/fiboknacky "fiboknacky (313 commits)")[![PierrickVoulet](https://avatars.githubusercontent.com/u/6769971?v=4)](https://github.com/PierrickVoulet "PierrickVoulet (193 commits)")[![Raibaz](https://avatars.githubusercontent.com/u/1030142?v=4)](https://github.com/Raibaz "Raibaz (49 commits)")[![yatskanich](https://avatars.githubusercontent.com/u/2090101?v=4)](https://github.com/yatskanich "yatskanich (7 commits)")[![Brothman](https://avatars.githubusercontent.com/u/5422354?v=4)](https://github.com/Brothman "Brothman (5 commits)")[![AnashOommen](https://avatars.githubusercontent.com/u/4514952?v=4)](https://github.com/AnashOommen "AnashOommen (3 commits)")[![jradcliff](https://avatars.githubusercontent.com/u/6033175?v=4)](https://github.com/jradcliff "jradcliff (3 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![alexeyshockov](https://avatars.githubusercontent.com/u/203120?v=4)](https://github.com/alexeyshockov "alexeyshockov (2 commits)")[![friedenberg](https://avatars.githubusercontent.com/u/181492?v=4)](https://github.com/friedenberg "friedenberg (2 commits)")[![stevenberger](https://avatars.githubusercontent.com/u/2490931?v=4)](https://github.com/stevenberger "stevenberger (2 commits)")[![yangda](https://avatars.githubusercontent.com/u/7431824?v=4)](https://github.com/yangda "yangda (2 commits)")[![danielfrg](https://avatars.githubusercontent.com/u/1580714?v=4)](https://github.com/danielfrg "danielfrg (1 commits)")[![kurorido](https://avatars.githubusercontent.com/u/300858?v=4)](https://github.com/kurorido "kurorido (1 commits)")[![laurachevalier4](https://avatars.githubusercontent.com/u/15260006?v=4)](https://github.com/laurachevalier4 "laurachevalier4 (1 commits)")[![mackenziestarr](https://avatars.githubusercontent.com/u/6363360?v=4)](https://github.com/mackenziestarr "mackenziestarr (1 commits)")[![makstech](https://avatars.githubusercontent.com/u/25028046?v=4)](https://github.com/makstech "makstech (1 commits)")[![mehmetcoban](https://avatars.githubusercontent.com/u/39200220?v=4)](https://github.com/mehmetcoban "mehmetcoban (1 commits)")[![michaelbausor](https://avatars.githubusercontent.com/u/14846209?v=4)](https://github.com/michaelbausor "michaelbausor (1 commits)")[![Neverage](https://avatars.githubusercontent.com/u/34798085?v=4)](https://github.com/Neverage "Neverage (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisRector

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/yatskanich-google-ads-php84/health.svg)

```
[![Health](https://phpackages.com/badges/yatskanich-google-ads-php84/health.svg)](https://phpackages.com/packages/yatskanich-google-ads-php84)
```

###  Alternatives

[googleads/google-ads-php

Google Ads API client for PHP

3427.3M8](/packages/googleads-google-ads-php)[temporal/sdk

Temporal SDK

3971.9M14](/packages/temporal-sdk)[alibaba/nacos

阿里巴巴nacos配置中心php客户端

19440.5k1](/packages/alibaba-nacos)[bigcommerce/grphp

gRPC PHP Framework

25601.1k1](/packages/bigcommerce-grphp)[hasanmertermis/milvus-php-client

Milvus 2 Grpc Php Client

142.1k](/packages/hasanmertermis-milvus-php-client)[passkit/passkit-php-grpc-sdk

PHP gRPC SDK for Apple Wallet and Google Pay Membership / Loyalty / Access Cards, Coupons, Flights &amp; Event-Tickets.

131.8k](/packages/passkit-passkit-php-grpc-sdk)

PHPackages © 2026

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