spotonlive / Laravel Google Ads
Licence: mit
Google Ads API for Laravel
Stars: ✭ 56
Projects that are alternatives of or similar to Laravel Google Ads
Laravel Amp
Package that helps you set up AMP (Accelerated Mobile Pages) using Laravel
Stars: ✭ 106 (+89.29%)
Mutual labels: google, laravel
Google Places Api
This is a PHP wrapper for Google Places API Web Service. And is Laravel Framework friendly.
Stars: ✭ 147 (+162.5%)
Mutual labels: google, laravel
Laravel Sitemap
Create and generate sitemaps with ease
Stars: ✭ 1,325 (+2266.07%)
Mutual labels: google, laravel
Laravel Analytics
A Laravel package to retrieve pageviews and other data from Google Analytics
Stars: ✭ 2,613 (+4566.07%)
Mutual labels: google, laravel
Skip Ad
A simple lightweight Chrome extension that automatically skips YouTube Ads.
Stars: ✭ 54 (-3.57%)
Mutual labels: ads, google
Laravel Google Calendar
Manage events on a Google Calendar
Stars: ✭ 787 (+1305.36%)
Mutual labels: google, laravel
Laravel Natural Language
This package makes using the Google Natural API in your laravel app a breeze with minimum to no configuration, clean syntax and a consistent package API.
Stars: ✭ 119 (+112.5%)
Mutual labels: google, laravel
Laravel Robots Middleware
Enable or disable the indexing of your app
Stars: ✭ 259 (+362.5%)
Mutual labels: google, laravel
Laravel Google Drive Demo
Laravel & Google Drive Storage - Demo project with Laravel 5.4
Stars: ✭ 299 (+433.93%)
Mutual labels: google, laravel
Versaplayer
Versatile Video Player implementation for iOS, macOS, and tvOS
Stars: ✭ 608 (+985.71%)
Mutual labels: ads, google
Socialite
Socialite is an OAuth2 Authentication tool. It is inspired by laravel/socialite, you can easily use it without Laravel.
Stars: ✭ 1,026 (+1732.14%)
Mutual labels: google, laravel
Optimus
🤖 Id obfuscation based on Knuth's multiplicative hashing method for PHP.
Stars: ✭ 1,084 (+1835.71%)
Mutual labels: laravel
Response Xml
The missing XML support for Laravel's Response class.
Stars: ✭ 56 (+0%)
Mutual labels: laravel
Espresso
🚚 Espresso is an express delivery tracking app designed with Material Design style, built on MVP(Model-View-Presenter) architecture with RxJava2, Retrofit2, Realm database and ZXing
Stars: ✭ 1,084 (+1835.71%)
Mutual labels: google
Laravel Vuejs.com
Laravel and VueJs Blog, using Laravel nova, GraphQL, NuxtJs, Apollo and ...more
Stars: ✭ 54 (-3.57%)
Mutual labels: laravel
Laravel Janitor
🔑 Easily add login proxy to your Laravel API
Stars: ✭ 54 (-3.57%)
Mutual labels: laravel
Google Ads API for Laravel
Integration of 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
'providers' => [
LaravelGoogleAds\LaravelGoogleAdsProvider::class,
],
- Run
$ php artisan vendor:publish
to publish the configuration fileconfig/google-ads.php
and insert:- developerToken
- clientId & clientSecret
- refreshToken
Lumen
- Add provider to
bootstrap/app.php
$app->register(LaravelGoogleAds\LaravelGoogleAdsProvider::class);
-
Copy
vendor/spotonlive/laravel-google-ads/config/config.php
toconfig/google-ads.php
and insert:- developerToken
- clientId & clientSecret
- refreshToken
-
Add config to
bootstrap/app.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
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
Features, requirements, support etc.
See googleads/googleads-php-lib
Dependencies
-
googleads/googleads-php-lib
hosts the PHP client library for the various SOAP-based Ads APIs (AdWords, AdExchange Buyer, and DFP) at Google.
Credits
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].