This uses the googleads-php-lib SDK for the Google Ads API.
You need access before you can use the Google Ads API. You can also setup a test account for sandbox mode.
Developer tokens – are located in the API Center within your Google Ads account. Go to "Tools" -> "API Center"
Create an application using the Google Cloud Platform
-
Select your project/application
-
Enable Google Ads API
-
"Create Credentials" for OAuth client (fill in name, email and add in Google Ads API as the scope)
-
Create OAuth Client ID (select Application type: Desktop App or Native App)
-
Fill in .env
ADWORDS_OAUTH2_CLIENT_ID
andADWORDS_OAUTH2_CLIENT_SECRET
Run php artisan laravelads:token:generate --service=GoogleAds
-
Copy and go to the URL shown after running that command
-
It will ask you to select/login to your Google Ads Account
-
Select "Allow" access to your application
-
Copy the code you see, and paste it into the command line; then copy and paste the refresh token you see into .env
ADWORDS_OAUTH2_REFRESH_TOKEN