KO
|
EN
gitlite — search
Search
#python
#java
#python3
#arduino
#golang
#machine-learning
#rust
#html
#flask
#javascript
#seismology
#nodejs
laravel-google-ads
★ 63
Open GitHub ↗
Google Ads API for Laravel
Download README (.md)
Explore Similar Repositories
google-ads-node
:
Google Ads API client library for Node.js
oculi
:
A Google Cloud-based pipeline for tagging image and video ads based on their content, enabling advanced creative analysis.
ads-api-report-fetcher
:
Google Ads API Report Fetcher (gaarf)
couchy-launcher
:
A fast, private one-screen launcher for Android TV & Google TV. No ads, no tracking, no accounts. FOSS.
playstore-adblock
:
Xposed module to remove sponsored listings and ads from the Google Play Store
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
laravel-google-ads
?
Download (.md)
<p align="center"> <img src="https://cloud.githubusercontent.com/assets/3541622/17292148/47c841ea-57e8-11e6-80c3-773dfd28a1f4.png" alt=""> </p> [](http://laravel.com) [](http://lumen.laravel.com) [](https://packagist.org/packages/spotonlive/laravel-google-ads) [](https://packagist.org/packages/spotonlive/laravel-google-ads) [](https://travis-ci.org/spotonlive/laravel-google-ads) [](https://codeclimate.com/github/spotonlive/laravel-google-ads) [](https://codeclimate.com/github/spotonlive/laravel-google-ads/coverage) ## Google Ads API for Laravel Integration of [`googleads/googleads-php-lib`](https://github.com/googleads/googleads-php-lib) in Laravel and Lumen (version >5). ### Setup - Run `$ composer require spotonlive/laravel-google-ads` #### Laravel - **(Only for Laravel 5.4 or minor)** Add provider to config/app.php ```php 'providers' => [ LaravelGoogleAds\LaravelGoogleAdsProvider::class, ], ``` - Run `$ php artisan vendor:publish` to publish the configuration file `config/google-ads.php` and insert: - developerToken - clientId & clientSecret - refreshToken #### Lumen - Add provider to `bootstrap/app.php` ```php $app->register(LaravelGoogleAds\LaravelGoogleAdsProvider::class); ``` - Copy `vendor/spotonlive/laravel-google-ads/config/config.php` to `config/google-ads.php` and insert: - developerToken - clientId & clientSecret - refreshToken - Add config to `bootstrap/app.php` ```php $app->configure('google-ads'); ``` ### 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 The following example is for AdWords, but the general code applies to all products. ```php <?php namespace App\Services; use LaravelGoogleAds\Services\AdWordsService; use Google\AdsApi\AdWords\AdWordsServices; use Google\AdsApi\AdWords\AdWordsSessionBuilder; use Google\AdsApi\AdWords\v201806\cm\CampaignService; use Google\AdsApi\AdWords\v201806\cm\OrderBy; use Google\AdsApi\AdWords\v201806\cm\Paging; use Google\AdsApi\AdWords\v201806\cm\Selector; class Service { /** @var AdWordsService */ protected $adWordsService; /** * @param AdWordsService $adWordsService */ public function __construct(AdWordsService $adWordsService) { $this->adWordsService = $adWordsService; } public function campaigns() { $customerClientId = 'xxx-xxx-xx'; $campaignService = $this->adWordsService->getService(CampaignService::class, $customerClientId); // Create selector. $selector = new Selector(); $selector->setFields(array('Id', 'Name')); $selector->setOrdering(array(new OrderBy('Name', 'ASCENDING'))); // Create paging controls. $selector->setPaging(new Paging(0, 100)); // Make the get request. $page = $campaignService->get($selector); } } ``` ### Best practices - [AdWords API Workshops Fall 2015](https://www.youtube.com/playlist?list=PLKByxjzUC-N8mEDQF9ARMMkSv0AmYbpsh) - [Best Practices in Reporting](https://www.youtube.com/watch?v=nRh-sIUqY84&index=2&list=PLKByxjzUC-N8mEDQF9ARMMkSv0AmYbpsh) ### Features, requirements, support etc. See [`googleads/googleads-php-lib`](https://github.com/googleads/googleads-php-lib/blob/master/README.md) ### Dependencies - [`googleads/googleads-php-lib`](https://github.com/googleads/googleads-php-lib) hosts the PHP client library for the various SOAP-based Ads APIs (AdWords, AdExchange Buyer, and DFP) at Google. ### Credits - [`SpotOn Marketing`](https://spotonmarketing.dk/) - [`nikolajlovenhardt`](https://github.com/nikolajlovenhardt)