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
  1. Python 3.8+ installed on your machine
  2. Install dependencies: pip install google-api-python-client google-auth pandas
  3. Create a service account in Google Cloud Console
  4. Enable the DV360 Reporting API in your Cloud project
  5. Download the service account JSON file (private key)
Configure the script
  1. Open carbon-intelligence-dv360-export.py
  2. In the CONFIG section, fill in:
    • SERVICE_ACCOUNT_PATH: path to the downloaded JSON
    • ADVERTISER_ID: your DV360 advertiser ID
  3. Optional: configure SPREADSHEET_URL to export to Google Sheets
  4. Optional: configure OUTPUT_DIR for local CSV export
Run the script
  1. Run: python carbon-intelligence-dv360-export.py
  2. To schedule execution:
    • Linux/Mac: use cron (e.g.: 0 9 * * 1 = Monday 9am)
    • Windows: use Task Scheduler
  3. Recommended: weekly execution on Monday morning
📊
What is exported
12 tabs created automatically
TabContentUsage Carbon Intelligence
CI_CampaignsBy insertion order and weekEmissions overview
CI_DeviceBy device (desktop, mobile, tablet, CTV)Energy factor
CI_GeoBy country and regionGMSF v1.2 energy mix
CI_PlacementsBy site/app and domainEnergy-intensive placements
CI_CreativeSizeBy creative dimensionsData transfer weight
CI_AdFormatBy format (Display, Video, Native, Audio, Rich Media)Format factor
CI_VideoDetailed video metrics (duration, quartiles)Video carbon calculation
CI_ExchangeBy exchange (Google, Index, OpenX, etc.)🎯 DV360 Exclusive
CI_ConnectionBy connection type (WiFi, 4G, 5G)🎯 DV360 Exclusive
CI_EnvironmentBy environment (Web, App, CTV)🎯 DV360 Exclusive
CI_MetadataExport and account informationTraceability
CI_Export_CSVAll dimensions consolidatedDirect CI import
📁
Export CSV
Two options available
Option A — Automatic CSV
The script automatically generates CSV files in OUTPUT_DIR
Option B — Google Sheets
Configure SPREADSHEET_URL for direct export
🔗
Sharing with Carbon Intelligence
📨
Share the Google Sheet with: support@carbonintelligence.green (accès lecteur)
Or send the exported CSV by email to the same address.
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
🛠️
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
Script version 1.0.0
Methodology GMSF v1.2 (Ad Net Zero)