PHPackages                             cpcstrategy/capx-google-ads - 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. [API Development](/categories/api)
4. /
5. cpcstrategy/capx-google-ads

ActiveLibrary[API Development](/categories/api)

cpcstrategy/capx-google-ads
===========================

Google Ads API for Laravel forked from nikolajlovenhardt/laravel-google-ads

1.0.0(9y ago)03.5kMITPHPPHP &gt;=5.5.9

Since Dec 22Pushed 9y ago10 watchersCompare

[ Source](https://github.com/CPCStrategy/capx-google-ads)[ Packagist](https://packagist.org/packages/cpcstrategy/capx-google-ads)[ Docs](https://github.com/nikolajlovenhardt/laravel-google-ads)[ RSS](/packages/cpcstrategy-capx-google-ads/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (7)Versions (12)Used By (0)

[![](https://cloud.githubusercontent.com/assets/3541622/17292148/47c841ea-57e8-11e6-80c3-773dfd28a1f4.png)](https://cloud.githubusercontent.com/assets/3541622/17292148/47c841ea-57e8-11e6-80c3-773dfd28a1f4.png)

[![Laravel 5.1+](https://camo.githubusercontent.com/aea3b08f2a2651b85a23a406226a32b1bac5ad181387e337b7ea651fcdf7aa6a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d352e312b2d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](http://laravel.com) [![Lumen 5.1+](https://camo.githubusercontent.com/845fc8d2f7f6541e3ef887cb7dfb6e22ffdc621463005964f65e2e329f7a219c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c756d656e2d352e312b2d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](http://lumen.laravel.com) [![Total Downloads](https://camo.githubusercontent.com/31a538dda1fac76aceaa6187d21ddbe5bdf216b7376df3e2dd545e9fbfadb129/68747470733a2f2f706f7365722e707567782e6f72672f6e696b6f6c616a6c6f76656e68617264742f6c61726176656c2d676f6f676c652d6164732f646f776e6c6f616473)](https://packagist.org/packages/nikolajlovenhardt/laravel-google-ads) [![License](https://camo.githubusercontent.com/45d8dff749f10f878d70bd21da462b39e08e77c6652dbcb3485cb618fc6d760d/68747470733a2f2f706f7365722e707567782e6f72672f6e696b6f6c616a6c6f76656e68617264742f6c61726176656c2d676f6f676c652d6164732f6c6963656e7365)](https://packagist.org/packages/nikolajlovenhardt/laravel-google-ads) [![Build Status](https://camo.githubusercontent.com/0fdc8e0e9fa324f1b1c63b02db54e10ad86a84fcf6c90eceb1e91aea8434def6/68747470733a2f2f7472617669732d63692e6f72672f6e696b6f6c616a6c6f76656e68617264742f6c61726176656c2d676f6f676c652d6164732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/nikolajlovenhardt/laravel-google-ads) [![Code Climate](https://camo.githubusercontent.com/796671a95e79e7d1812465135656815527605e84caf7b0af44ae3eb85a36696a/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6e696b6f6c616a6c6f76656e68617264742f6c61726176656c2d676f6f676c652d6164732f6261646765732f6770612e737667)](https://codeclimate.com/github/nikolajlovenhardt/laravel-google-ads) [![Test Coverage](https://camo.githubusercontent.com/17edf88cbe5116a9bd85bf4328f9b61729dbd00366273b1db7d7b72ee790b521/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6e696b6f6c616a6c6f76656e68617264742f6c61726176656c2d676f6f676c652d6164732f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/nikolajlovenhardt/laravel-google-ads/coverage)

Google Ads API for Laravel
--------------------------

[](#google-ads-api-for-laravel)

Integration of [`googleads/googleads-php-lib`](https://github.com/googleads/googleads-php-lib) in Laravel and Lumen (version &gt;5).

### Setup

[](#setup)

- Run `$ composer require nikolajlovenhardt/laravel-google-ads`

#### Laravel

[](#laravel)

- Add provider to config/app.php

```
'providers' => [
    LaravelGoogleAds\LaravelGoogleAdsProvider::class,
],
```

- Run `$ php artisan vendor:publish` to publish the configuration file `config/google-ads.php` and insert:
    - developerToken
    - clientId &amp; clientSecret
    - refreshToken

#### Lumen

[](#lumen)

- Add provider to `bootstrap/app.php`

```
$app->register(LaravelGoogleAds\LaravelGoogleAdsProvider::class);
```

- Copy `vendor/nikolajlovenhardt/laravel-google-ads/config/config.php` to `config/google-ads.php` and insert:

    - developerToken
    - clientId &amp; clientSecret
    - refreshToken
- Add config to `bootstrap/app.php`

```
$app->configure('google-ads');
```

### Generate refresh token

[](#generate-refresh-token)

*This requires that the `clientId` and `clientSecret` is from a native application.*

Run `$ php artisan googleads:token:generate` and open the authorization url. Grant access to the app, and input the access token in the console. Copy the refresh token into your configuration `config/google-ads.php`

### Basic usage

[](#basic-usage)

The following example is for AdWords, but the general code applies to all products.

```
