### Install laravel-google-ads Source: https://github.com/jeffersongoncalves/laravel-google-ads/blob/main/README.md Install the package via Composer. ```bash composer require jeffersongoncalves/laravel-google-ads ``` -------------------------------- ### Usage examples for GoogleAdsClient Source: https://github.com/jeffersongoncalves/laravel-google-ads/blob/main/README.md Basic usage of the GoogleAdsClient static methods: search, accountInfo, campaigns, campaignsPerformance, pauseCampaign, enableCampaign, adGroupsPerformance, keywordsPerformance, updateBudget, and targeting a different customer ID. ```php use JeffersonGoncalves\GoogleAds\GoogleAdsClient; // Run any GAQL query — customer id defaults to config('google-ads.customer_id') $rows = GoogleAdsClient::search('SELECT campaign.id, campaign.name FROM campaign'); // Account info $account = GoogleAdsClient::accountInfo(); // Campaigns $campaigns = GoogleAdsClient::campaigns(); $performance = GoogleAdsClient::campaignsPerformance(days: 7); // Toggle a campaign GoogleAdsClient::pauseCampaign('111'); GoogleAdsClient::enableCampaign('111'); // Ad groups and keywords $adGroups = GoogleAdsClient::adGroupsPerformance(days: 30, limit: 10); $keywords = GoogleAdsClient::keywordsPerformance(days: 30, limit: 50); // Update a budget (amount in dollars, converted to micros) GoogleAdsClient::updateBudget('222', 25.00); // Target a different account than the configured default $rows = GoogleAdsClient::campaigns(customerId: '987-654-3210'); ``` -------------------------------- ### Publish config file Source: https://github.com/jeffersongoncalves/laravel-google-ads/blob/main/README.md Optionally publish the configuration file. ```bash php artisan vendor:publish --tag="google-ads-config" ``` -------------------------------- ### Run static analysis Source: https://github.com/jeffersongoncalves/laravel-google-ads/blob/main/README.md Run static analysis. ```bash composer analyse ``` -------------------------------- ### Run tests Source: https://github.com/jeffersongoncalves/laravel-google-ads/blob/main/README.md Run the test suite. ```bash composer test ``` -------------------------------- ### Run code formatting Source: https://github.com/jeffersongoncalves/laravel-google-ads/blob/main/README.md Run code formatting. ```bash composer format ``` -------------------------------- ### Config file google-ads.php Source: https://github.com/jeffersongoncalves/laravel-google-ads/blob/main/README.md Configuration file for the package. Maps environment variables to config keys, with defaults for version and timeout. ```php // config/google-ads.php return [ 'access_token' => env('GOOGLE_ADS_ACCESS_TOKEN'), 'developer_token' => env('GOOGLE_ADS_DEVELOPER_TOKEN'), 'customer_id' => env('GOOGLE_ADS_CUSTOMER_ID'), 'login_customer_id' => env('GOOGLE_ADS_LOGIN_CUSTOMER_ID'), 'version' => env('GOOGLE_ADS_API_VERSION', 'v19'), 'timeout' => (int) env('GOOGLE_ADS_TIMEOUT', 8), ]; ``` -------------------------------- ### Configure .env for Google Ads Source: https://github.com/jeffersongoncalves/laravel-google-ads/blob/main/README.md Environment variables for the Google Ads API client. GOOGLE_ADS_ACCESS_TOKEN is the OAuth bearer token, GOOGLE_ADS_DEVELOPER_TOKEN identifies your application, GOOGLE_ADS_CUSTOMER_ID is the default account, GOOGLE_ADS_LOGIN_CUSTOMER_ID is only needed for MCC accounts, GOOGLE_ADS_API_VERSION should track a supported version, and GOOGLE_ADS_TIMEOUT sets the request timeout. ```env GOOGLE_ADS_ACCESS_TOKEN=ya29.xxxxxxxxxxxxxxxxxxxx GOOGLE_ADS_DEVELOPER_TOKEN=xxxxxxxxxxxxxxxxxxxxxx GOOGLE_ADS_CUSTOMER_ID=1234567890 GOOGLE_ADS_LOGIN_CUSTOMER_ID= GOOGLE_ADS_API_VERSION=v19 GOOGLE_ADS_TIMEOUT=8 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.