Skip to main content

Garf implementation for Google Campaign Manager 360 API

Project description

garf for Campaign Manager 360 API

PyPI Downloads PyPI

garf-campaign-manager simplifies fetching data from Campaign Manager 360 API using SQL-like queries.

Prerequisites

Installation

pip install garf-campaign-manager

Usage

Run as a library

from garf.community.google.campaign_manager import CampaignManager360ApiReportFetcher
from garf.io import writer

# Fetch report
query = """
  SELECT
    dimensions.advertiser AS advertiser,
    advertiserId AS advertiser_id,
    metric.clicks AS clicks
  FROM standard
  WHERE
    dateRange IN (2025-01-01, 2025-12-31)
"""
fetched_report = CampaignManager360ApiReportFetcher(profile_id=<PROFILE_ID>).fetch(query, title='sample_query')

# Write report to console
console_writer = writer.create_writer('console')
console_writer.write(fetched_report, 'output')

Run via CLI

Install garf-executors package to run queries via CLI (pip install garf-executors).

garf <PATH_TO_QUERIES> --source campaign-manager \
  --output <OUTPUT_TYPE> \
  --source.<SOURCE_PARAMETER=VALUE>

where:

Available source parameters

name values comments
profile_id Id of CM360 profile
credentials_file File with Oauth or service account credentials You can expose credentials_file as GARF_CAMPAIGN_MANAGER_360_CREDENTIALS_FILE ENV variable
auth_mode Type of authentication: oauth or service_account oauth is the default mode

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

garf_campaign_manager-0.0.1.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

garf_campaign_manager-0.0.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file garf_campaign_manager-0.0.1.tar.gz.

File metadata

File hashes

Hashes for garf_campaign_manager-0.0.1.tar.gz
Algorithm Hash digest
SHA256 720d76592c157d8e82f139c2255c5c4fc63ca958ce48762e483491003be13880
MD5 ce2dd4d3309e28af0f1aa17961e8bce0
BLAKE2b-256 ac457e7dd35497aaf0bcdf14d6b489b74b2d2d427884567eb0ef675c395b6f82

See more details on using hashes here.

File details

Details for the file garf_campaign_manager-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for garf_campaign_manager-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 15bcfa9603e6b79a129703dd16ef167e8ed7a043e5cdafa2dd50eab89c4ce85f
MD5 b379974bba4a54b77419b3a11666ffae
BLAKE2b-256 20ed98027d238a615e38d7664608611f55834376a82757318cbd3c0c5ad3921a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page