{"id":13708861,"url":"https://github.com/spotonlive/laravel-google-ads","last_synced_at":"2025-04-06T04:11:03.621Z","repository":{"id":2969776,"uuid":"48040656","full_name":"spotonlive/laravel-google-ads","owner":"spotonlive","description":"Google Ads API for Laravel","archived":false,"fork":false,"pushed_at":"2022-08-18T08:20:00.000Z","size":122,"stargazers_count":63,"open_issues_count":5,"forks_count":58,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-30T03:04:39.141Z","etag":null,"topics":["ads","google","laravel"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spotonlive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-15T12:11:04.000Z","updated_at":"2025-02-28T11:47:23.000Z","dependencies_parsed_at":"2022-09-16T14:11:20.500Z","dependency_job_id":null,"html_url":"https://github.com/spotonlive/laravel-google-ads","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spotonlive%2Flaravel-google-ads","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spotonlive%2Flaravel-google-ads/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spotonlive%2Flaravel-google-ads/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spotonlive%2Flaravel-google-ads/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spotonlive","download_url":"https://codeload.github.com/spotonlive/laravel-google-ads/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247430870,"owners_count":20937874,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ads","google","laravel"],"created_at":"2024-08-02T23:00:33.547Z","updated_at":"2025-04-06T04:11:03.481Z","avatar_url":"https://github.com/spotonlive.png","language":"PHP","funding_links":[],"categories":["Client libraries"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://cloud.githubusercontent.com/assets/3541622/17292148/47c841ea-57e8-11e6-80c3-773dfd28a1f4.png\" alt=\"\"\u003e\n\u003c/p\u003e\n\n[![Laravel 5.1+](https://img.shields.io/badge/Laravel-5.3+-orange.svg?style=flat-square)](http://laravel.com) [![Lumen 5.1+](https://img.shields.io/badge/Lumen-5.3+-orange.svg?style=flat-square)](http://lumen.laravel.com)  [![Total Downloads](https://poser.pugx.org/spotonlive/laravel-google-ads/downloads)](https://packagist.org/packages/spotonlive/laravel-google-ads) [![License](https://poser.pugx.org/spotonlive/laravel-google-ads/license)](https://packagist.org/packages/spotonlive/laravel-google-ads) [![Build Status](https://travis-ci.org/spotonlive/laravel-google-ads.svg?branch=master)](https://travis-ci.org/spotonlive/laravel-google-ads) [![Code Climate](https://codeclimate.com/github/spotonlive/laravel-google-ads/badges/gpa.svg)](https://codeclimate.com/github/spotonlive/laravel-google-ads) [![Test Coverage](https://codeclimate.com/github/spotonlive/laravel-google-ads/badges/coverage.svg)](https://codeclimate.com/github/spotonlive/laravel-google-ads/coverage)\n\n## Google Ads API for Laravel\n\nIntegration of [`googleads/googleads-php-lib`](https://github.com/googleads/googleads-php-lib) in Laravel and Lumen (version \u003e5).\n\n### Setup\n- Run `$ composer require spotonlive/laravel-google-ads`\n\n#### Laravel\n\n- **(Only for Laravel 5.4 or minor)** Add provider to config/app.php\n\n```php\n'providers' =\u003e [\n    LaravelGoogleAds\\LaravelGoogleAdsProvider::class,\n],\n```\n\n- Run `$ php artisan vendor:publish` to publish the configuration file `config/google-ads.php` and insert:\n    - developerToken\n    - clientId \u0026 clientSecret\n    - refreshToken\n\n#### Lumen\n\n- Add provider to `bootstrap/app.php`\n\n```php\n$app-\u003eregister(LaravelGoogleAds\\LaravelGoogleAdsProvider::class);\n```\n\n- Copy `vendor/spotonlive/laravel-google-ads/config/config.php` to `config/google-ads.php` and insert:\n    - developerToken\n    - clientId \u0026 clientSecret\n    - refreshToken\n\n- Add config to `bootstrap/app.php`\n\n```php\n$app-\u003econfigure('google-ads');\n```\n\n### Generate refresh token\n*This requires that the `clientId` and `clientSecret` is from a native application.*\n\nRun `$ php artisan googleads:token:generate` and open the authorization url. Grant access to the app, and input the\naccess token in the console. Copy the refresh token into your configuration `config/google-ads.php`\n\n### Basic usage\n\nThe following example is for AdWords, but the general code applies to all\nproducts.\n\n\n```php\n\u003c?php\n\nnamespace App\\Services;\n\nuse LaravelGoogleAds\\Services\\AdWordsService;\nuse Google\\AdsApi\\AdWords\\AdWordsServices;\nuse Google\\AdsApi\\AdWords\\AdWordsSessionBuilder;\nuse Google\\AdsApi\\AdWords\\v201806\\cm\\CampaignService;\nuse Google\\AdsApi\\AdWords\\v201806\\cm\\OrderBy;\nuse Google\\AdsApi\\AdWords\\v201806\\cm\\Paging;\nuse Google\\AdsApi\\AdWords\\v201806\\cm\\Selector;\n\nclass Service\n{\n    /** @var AdWordsService */\n    protected $adWordsService;\n    \n    /**\n     * @param AdWordsService $adWordsService\n     */\n    public function __construct(AdWordsService $adWordsService)\n    {\n        $this-\u003eadWordsService = $adWordsService;\n    }\n\n    public function campaigns()\n    {\n        $customerClientId = 'xxx-xxx-xx';\n\n        $campaignService = $this-\u003eadWordsService-\u003egetService(CampaignService::class, $customerClientId);\n\n        // Create selector.\n        $selector = new Selector();\n        $selector-\u003esetFields(array('Id', 'Name'));\n        $selector-\u003esetOrdering(array(new OrderBy('Name', 'ASCENDING')));\n\n        // Create paging controls.\n        $selector-\u003esetPaging(new Paging(0, 100));\n\n        // Make the get request.\n        $page = $campaignService-\u003eget($selector);\n    }\n}\n```\n\n### Best practices\n- [AdWords API Workshops Fall 2015](https://www.youtube.com/playlist?list=PLKByxjzUC-N8mEDQF9ARMMkSv0AmYbpsh)\n- [Best Practices in Reporting](https://www.youtube.com/watch?v=nRh-sIUqY84\u0026index=2\u0026list=PLKByxjzUC-N8mEDQF9ARMMkSv0AmYbpsh)\n\n### Features, requirements, support etc.\nSee [`googleads/googleads-php-lib`](https://github.com/googleads/googleads-php-lib/blob/master/README.md)\n\n### Dependencies\n- [`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.\n\n### Credits\n- [`SpotOn Marketing`](https://spotonmarketing.dk/)\n- [`nikolajlovenhardt`](https://github.com/nikolajlovenhardt)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspotonlive%2Flaravel-google-ads","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspotonlive%2Flaravel-google-ads","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspotonlive%2Flaravel-google-ads/lists"}