Zac Cannon
December 11, 2024
The Problem: Keeping track of Google Ads spend across multiple campaigns can be time-consuming and error-prone. Manual exports are tedious, and you might miss important spending trends or budget overruns until it's too late.
What this script does: This script automatically exports your daily Google Ads costs at the campaign level to a Google Sheet. It captures essential metrics including:
Daily spend by campaign
Monthly aggregation
Impressions, clicks, and conversions
Conversion value
How this script will save you time & money:
Eliminates manual data exports (avoids Supermetrics)
Provides daily spend tracking without logging into Google Ads
Helps identify campaigns that are overspending or underperforming
Creates a historical record for better budget planning
Enables quick month-over-month spend analysis
Setup Requirements:
Google Ads account with script access
Google Sheet to store the data
Basic configuration (2-minute setup)
How to Install:
Create a new Google Sheet
Create a new tab named according to your preference
Copy the Sheet URL
In Google Ads:
Go to Tools & Settings > Bulk Actions > Scripts
Click the plus button to create a new script
Copy and paste the provided code
Update the settings variable with your Sheet URL and tab name
Save and authorise the script
Schedule the Script:
Click the plus button in the frequency column
Set to run daily (recommended time: early morning)
The script will automatically populate your sheet with the previous day's data
Understanding the Output: The script exports the following columns:
Date: The day the costs were incurred
Month: For easy monthly aggregation
Campaign Name: Individual campaign identification
Cost: Daily spend in your account's currency
Impressions: Number of ad shows
Clicks: Number of ad clicks
Conversions: Number of recorded conversions
Conversion Value: Total value from conversions
Customisation Options: You can modify the script to:
Change the date range (currently set from 2022)
Add additional metrics like CTR or CPA
Include other dimensions like ad groups or device
Adjust the output format
Troubleshooting: If you encounter issues:
Verify your Google Sheet URL and tab name are correct
Ensure the script has proper authorization
Check that your Sheet isn't at maximum row capacity
Confirm your date ranges are valid
This script provides a foundation for automated cost tracking that you can build upon based on your specific needs. Whether you're managing a small account or a large portfolio, having automated daily cost exports will save time and improve your ability to manage budgets effectively.
Access the script here: https://docs.google.com/document/d/1v4mV65k3x-KEBj555wQFGsDWbCjIxsGjAalfnFaOaIA/edit?tab=t.0