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.2.tar.gz (8.6 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.2-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for garf_campaign_manager-0.0.2.tar.gz
Algorithm Hash digest
SHA256 1f43dc829bbc4b99c7566db8a9a196229b6b2a11532f04c0da50757be7f921f8
MD5 d7fe4aa22a2ee130483c02466abf2577
BLAKE2b-256 e2fa0e2c8d2db0de2fbacc0dbdf44db104102a6af0008531aeb2aec88ebf73e8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for garf_campaign_manager-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 433e005109fabe9dc692ab8d1040156377330369b46882abecd28d6806812cf1
MD5 23560dffdaeab098ef7be10a9a973686
BLAKE2b-256 8b484faa9c04be2556d50bfafdcf25f8a7cf07d83415f2188a3de815bd4c34b7

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