Getting data from Display & Video 360 (Bid Manager)
You can get video performance data from various campaigns in Display & Video 360 via Bid Manager API.
Prerequisites
- Bid Manager API enabled.
- Credentials configured, can be exposed as
GARF_BID_MANAGER_CREDENTIALS_FILEENV variable
Usage
media-fetcher \
--source dbm \
--dbm.advertiser=ACCOUNT_ID
import media_fetching
from media_fetching.sources import dbm
fetcher = media_fetching.MediaFetchingService(source='dbm')
request = dbm.BidManagerFetchingParameters(
advertiser='ADVERTISER_ID',
)
report = fetcher.fetch(request)
Reports can be written and processed. Learn more at garf.
Parameters
Mandatory
advertiser- Advertiser to get data from.
Optional
ads-config- Path togoogle-ads.yamlfile. If not provided then:- Environmental variable
GOOGLE_ADS_CONFIGURATION_FILE_PATH - Searched
$HOMEdirectory asgoogle-ads.yaml.
- Environmental variable
line_item_type- Type of line item.country- One or many countries.start-date- First date of the period inYYYY-MM-DDformat (i.e.2025-01-01). Defaults to 30 days ago.end-date- Last date of the period inYYYY-MM-DDformat. Defaults to yesterday.campaigns- specific campaign names to get data from.metrics- metrics compatible withYOUTUBEresource (by defaultmetrics,clicksandtotal_media_cost).
media-fetcher \
--source dbm \
--media-type YOUTUBE_VIDEO \
--dbm.advertiser=ADVERTISER_ID \
--dbm.line-item-type='Demand Gen' \
--dbm.start-date=2025-01-01 \
--dbm.end-date=2025-01-31 \
--dbm.country="United States"
import media_fetching
from media_fetching.sources import dbm
fetcher = media_fetching.MediaFetchingService(source='dbm')
request = dbm.BidManagerFetchingParameters(
advertiser='ADVERTISER_ID',
line_item_type='Demand Gen',
start_date='2025-01-01',
end_date='2025-01-31',
country='United States'
)
report = fetcher.fetch(request)