schulzefelix/laravel-adwords-targeting-idea-service
| Install | |
|---|---|
composer require schulzefelix/laravel-adwords-targeting-idea-service |
|
| Latest Version: | 1.9.0 |
| PHP: | ^8.0.2 |
| License: | MIT |
| Last Updated: | Mar 20, 2022 |
| Links: | GitHub · Packagist |
A Laravel API Wrapper For Google AdWords.
Install
This package can be installed through Composer.
$ composer require schulzefelix/laravel-adwords-targeting-idea-service
The package will autoregister the service provider. If package discovery is disabled add the following.
// config/app.php
'providers' => [
...
SchulzeFelix\AdWords\AdWordsServiceProvider::class,
...
];
The package will autoregister the facade. If package discovery is disabled add the following.
// config/app.php
'aliases' => [
...
'AdWords' => SchulzeFelix\AdWords\AdWordsFacade::class,
...
];
You can publish the config file of this package with this command:
php artisan vendor:publish --provider="SchulzeFelix\AdWords\AdWordsServiceProvider"
Generate Refresh Token
This requires that the clientId and clientSecret are from a native application.
Google Console: https://console.developers.google.com/apis/credentials
$ php artisan adwords:token
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/adwords-targeting-idea-service.php
Usage
All methods will return an Illuminate\Support\Collection-instance.
Here are two basic example to retrieve search volumes for several keywords and new keyword ideas for a given word.
Search Volumes
$searchVolumes = AdWords::searchVolumes(['cheesecake', 'coffee']);
Keyword Ideas
$keywordIdeas = AdWords::keywordIdeas('coffee');
Provided fluent configuration
Set Location
For Criteria ID see https://developers.google.com/adwords/api/docs/appendix/geotargeting
AdWords::location(2276)->searchVolumes(['cheesecake', 'coffee']);
Set Language
For Criteria ID see https://developers.google.com/adwords/api/docs/appendix/codes-formats#languages
AdWords::location(2276)->language(1001)->searchVolumes(['cheesecake', 'coffee']);
Include Targeted Monthly Searches
AdWords::withTargetedMonthlySearches()->searchVolumes(['cheesecake', 'coffee']);
Convert NULL values to Zero
AdWords::convertNullToZero()->location(2276)->language(1001)->searchVolumes(['cheesecake', 'coffee']);
Include And Exclude Words For Keyword Ideas
AdWords::location(2642)->exclude(['iphone'])->include(['apple'])->keywordIdeas('iphone');
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
$ vendor/bin/phpunit
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email github@schulze.co instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
Related Packages
Data Transfer Objects with Attribute Casting and Date Mutators.
Google Ads API for Laravel forked from nikolajlovenhardt/laravel-google-ads
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 1.9.0 | ^8.0.2 | ^9.0 | MIT | |
| 1.8.0 | ^7.3| | ^8.0 | MIT | |
| 1.7.0 | ^7.3 | ^8.0 | MIT | |
| 1.6.0 | ^7.2.5 | ^7.0 | MIT | |
| 1.5.0 | ^7.2 | ^6.0 | MIT | |
| 1.4.1 | >=7.1.0 | ~5.8.0 | MIT | |
| 1.4.0 | >=7.1.0 | ~5.8.0 | MIT | |
| 1.3.4 | >=7.0.0 | ~5.5.0| | MIT | |
| 1.3.3 | >=7.0.0 | ~5.5.0| | MIT | |
| 1.3.2 | >=7.0.0 | ~5.5.0| | MIT | |
| 1.3.1 | >=7.0.0 | ~5.5.0 | MIT | |
| 1.3.0 | >=7.0.0 | ~5.5.0 | MIT | |
| 1.2.0 | ^7.0 | ~5.1 | MIT | |
| 1.1.0 | ^7.0 | ~5.1 | MIT | |
| 1.0.0 | ^7.0 | ~5.1 | MIT |
