Matatika / tap-googleads

0 stars 11 forks source link

tap-googleads

tap-googleads is a Singer tap for GoogleAds.

This fork of tap-googleads will sync your GoogleAds data under the specified customer_id.

Built with the Meltano Tap SDK for Singer Taps.

Installation

To install and use this tap with Meltano:

meltano add extractor tap-googleads

To use standalone, you can use the following:

pip install https://github.com/Matatika/tap-googleads.git

Configuration

Accepted Config Options

This tap supports two sets of configs:

Using Your Own Credentials

Settings required to run this tap.

If using a manager account, login_customer_id should be set to the customer ID of the manager account while customer_id should be set to the customer ID of the account you want to sync.

How to get these settings can be found in the following Google Ads documentation:

https://developers.google.com/adwords/api/docs/guides/authentication

https://developers.google.com/google-ads/api/docs/first-call/dev-token

If you have installed the tap you can run the following commands to see more information about the tap.

tap-googleads --about

Proxy OAuth Credentials

To run the tap yourself It is highly recommended to use the Using Your Own Credentials section listed above.

These settings for handling your credentials through a Proxy OAuth Server, these settings are used by default in a Matatika workspace.

The benefit to using these settings in your Matatika workspace is that you do not have to get or provide any of the OAuth credentials. All a user needs to do it allow the Matatika App permissions to access your GoogleAds data, and choose what customer_id you want to get data from.

All you need to provide in your Matatika workspace are:

These are not intended for a user to set manually, as such setting them could cause some config conflicts that will now allow the tap to work correctly.

Also set in by default in your Matatika workspace environment:

Source Authentication and Authorization

Usage

You can easily run tap-googleads by itself or in a pipeline using Meltano.

Executing the Tap Directly

tap-googleads --version
tap-googleads --help
tap-googleads --config CONFIG --discover > ./catalog.json

Developer Resources

Initialize your Development Environment

pipx install poetry
poetry install

Create and Run Tests

Create tests within the tap_googleads/tests subfolder and then run:

poetry run pytest

You can also test the tap-googleads CLI interface directly using poetry run:

poetry run tap-googleads --help

Testing with Meltano

Note: This tap will work in any Singer environment and does not require Meltano. Examples here are for convenience and to streamline end-to-end orchestration scenarios.

Your project comes with a custom meltano.yml project file already created. Open the meltano.yml and follow any "TODO" items listed in the file.

Next, install Meltano (if you haven't already) and any needed plugins:

# Install meltano
pipx install meltano
# Initialize meltano within this directory
cd tap-googleads
meltano install

Now you can test and orchestrate using Meltano:

# Test invocation:
meltano invoke tap-googleads --version
# OR run a test `elt` pipeline:
meltano elt tap-googleads target-jsonl

SDK Dev Guide

See the dev guide for more instructions on how to use the SDK to develop your own taps and targets.