Carbon Intelligence™
DV360 Export Guide — Python Script
GMSF v1.2
DV360
10 min install
Objective
This Python script automatically exports your DV360 campaign data with maximum granularity for GMSF v1.2 carbon analysis in Carbon Intelligence™. DV360 offers exclusive dimensions not available in Google Ads: connection type, exchange, environment, and buy mode.
Installation
3 steps · 10 minutes
Prerequisites
- Python 3.8+ installed on your machine
- Install dependencies:
pip install google-api-python-client google-auth pandas - Create a service account in Google Cloud Console
- Enable the DV360 Reporting API in your Cloud project
- Download the service account JSON file (private key)
Configure the script
- Open
carbon-intelligence-dv360-export.py - In the CONFIG section, fill in:
- •
SERVICE_ACCOUNT_PATH: path to the downloaded JSON - •
ADVERTISER_ID: your DV360 advertiser ID
- •
- Optional: configure
SPREADSHEET_URLto export to Google Sheets - Optional: configure
OUTPUT_DIRfor local CSV export
Run the script
- Run:
python carbon-intelligence-dv360-export.py - To schedule execution:
- • Linux/Mac: use
cron(e.g.:0 9 * * 1= Monday 9am) - • Windows: use Task Scheduler
- • Linux/Mac: use
- Recommended: weekly execution on Monday morning
What is exported
12 tabs created automatically
| Tab | Content | Usage Carbon Intelligence |
|---|---|---|
| CI_Campaigns | By insertion order and week | Emissions overview |
| CI_Device | By device (desktop, mobile, tablet, CTV) | Energy factor |
| CI_Geo | By country and region | GMSF v1.2 energy mix |
| CI_Placements | By site/app and domain | Energy-intensive placements |
| CI_CreativeSize | By creative dimensions | Data transfer weight |
| CI_AdFormat | By format (Display, Video, Native, Audio, Rich Media) | Format factor |
| CI_Video | Detailed video metrics (duration, quartiles) | Video carbon calculation |
| CI_Exchange | By exchange (Google, Index, OpenX, etc.) | 🎯 DV360 Exclusive |
| CI_Connection | By connection type (WiFi, 4G, 5G) | 🎯 DV360 Exclusive |
| CI_Environment | By environment (Web, App, CTV) | 🎯 DV360 Exclusive |
| CI_Metadata | Export and account information | Traceability |
| CI_Export_CSV | All dimensions consolidated | Direct CI import |
Export CSV
Two options available
Option A — Automatic CSV
The script automatically generates CSV files in
OUTPUT_DIROption B — Google Sheets
Configure
SPREADSHEET_URL for direct exportSharing with Carbon Intelligence™
Advantages vs Google Ads
DV360 exclusive dimensions
Connection type (WiFi/4G/5G) — not available in Google Ads
Multiple exchanges — not available in Google Ads
Buy mode (Open/PMP/PG) — not available in Google Ads
Environment (Web/App/CTV) — not available in Google Ads
Advanced Configuration
Script CONFIG section
# In the script, CONFIG section:
LOOKBACK_DAYS: 90, # Days of history
MIN_IMPRESSIONS: 10, # Minimum threshold
INCLUDE_PAUSED: False, # Paused campaigns
OUTPUT_FORMAT: 'csv', # csv or sheets
LOOKBACK_DAYS: 90, # Days of history
MIN_IMPRESSIONS: 10, # Minimum threshold
INCLUDE_PAUSED: False, # Paused campaigns
OUTPUT_FORMAT: 'csv', # csv or sheets
Troubleshooting
"Authentication failed"
Check the path to the service account JSON file in
SERVICE_ACCOUNT_PATH."API not enabled"
Enable the DV360 Reporting API in Google Cloud Console for your project.
"Advertiser not found"
Check the advertiser ID in
ADVERTISER_ID — must match your DV360 account.Timeout
Reduce
LOOKBACK_DAYS to 30 days if the API takes too long."No data"
Check that active campaigns exist for the period. Increase
LOOKBACK_DAYS if needed.Support
Email
support@carbonintelligence.green
Website
carbonintelligence.green
Script version
1.0.0
Methodology
GMSF v1.2 (Ad Net Zero)