Skip to main content

AdWords reporting tools

Project description

zr

AdWords reporting tools

To install: pip install zr

Overview

The zr package provides a suite of tools designed to facilitate the reporting and analysis of Google AdWords campaigns. It includes functionality to handle AdWords client interactions, report downloading, and data transformation into user-friendly formats such as pandas DataFrames.

Features

  • Client Management: Easily manage AdWords client configurations and authenticate sessions.
  • Report Downloading: Download various types of AdWords performance reports using flexible query options.
  • Data Processing: Convert raw report data into structured pandas DataFrames, making it easier to analyze and visualize campaign performance.

Installation

Install the package using pip:

pip install zr

Usage

Getting Started with Client Configuration

To interact with Google AdWords, you need to configure and authenticate a client. Here's how you can do it:

from zr import get_client
client = get_client(clientCustomerId='your_customer_id')

Downloading Reports

You can download reports by specifying the type of report and the format you need. Here's an example of downloading a search query performance report:

from zr import get_report_downloader, download_report

# Get a report downloader instance
report_downloader = get_report_downloader(client='your_client_id')

# Define your report query
report_query_str = """
SELECT Query, Impressions, Clicks, Cost
FROM SEARCH_QUERY_PERFORMANCE_REPORT
WHERE CampaignStatus = ENABLED
DURING LAST_30_DAYS
"""

# Download the report as a DataFrame
df = download_report(
    report_downloader=report_downloader,
    report_query_str=report_query_str,
    download_format='df'
)

Converting Reports to DataFrames

After downloading the report, you can convert it into a pandas DataFrame for easier manipulation and analysis:

from zr import report_to_df

# Assuming 'report' is the raw data fetched from AdWords
df = report_to_df(report)

Documentation

Each function in the zr package is documented with docstrings, providing a detailed description of its purpose, parameters, and return values. This allows users to understand and utilize the functionalities effectively without diving deep into the source code.

Key Functions

  • get_client(): Configure and return a Google AdWords client.
  • get_report_downloader(): Get a downloader object that can be used to fetch reports based on the client configuration.
  • download_report(): Download AdWords reports using AWQL (AdWords Query Language).
  • report_to_df(): Convert the raw report data into a pandas DataFrame.

Contributing

Contributions to the zr package are welcome! If you have suggestions for improvements or bug fixes, please feel free to fork the repository and submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

zr-0.0.5.tar.gz (21.3 kB view details)

Uploaded Source

Built Distribution

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

zr-0.0.5-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file zr-0.0.5.tar.gz.

File metadata

  • Download URL: zr-0.0.5.tar.gz
  • Upload date:
  • Size: 21.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for zr-0.0.5.tar.gz
Algorithm Hash digest
SHA256 cc5985fb8416faa2b461e0ccbcc143c0b37ef2ef3440432c7a94b23961e24113
MD5 cdbc776e619e9035c62357db97fa706d
BLAKE2b-256 b59e864b7360d485d9a4bf7ff0c6423b240def78ba7fac92fa1958259427ab29

See more details on using hashes here.

File details

Details for the file zr-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: zr-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for zr-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7837d02e47a714527e0a5473a18ade964ba398e08f40a68866e7aafca979f87c
MD5 222d34bb32ec0cb4ceee348d69719b00
BLAKE2b-256 e2ba30053fd00a3178a0f6fd2c6c203d70c483b6cb7b4696b2889d33b0c6f3b4

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