Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TDL-18524 updated readme and added sample config #74

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,38 @@
# tap-google-analytics

This tap is currently under development, and incomplete.
This is a [Singer](https://singer.io) tap that produces JSON-formatted data following the [Singer spec](https://github.com/singer-io/getting-started/blob/master/SPEC.md).

How to use it:
- `tap-google-analytics` works together with any other [Singer Target](https://singer.io) to move data from Google Analytics API to any target destination.
- Extracts the following pre-made and any self-made reports from [Google Analytics Reporting API](https://developers.google.com/analytics/devguides/reporting/core/v4/rest/v4/reports/batchGet):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you mention the field selection for pre-made reports must follow google's exclusion rule, and point users to the Metrics & Dimensions page https://ga-dev-tools.web.app/dimensions-metrics-explorer/. These rules are handled in the Stitch UI by dynamically marking fields as unsupported as you select a field, but will need to be handled by the user if they wish to run the tap directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a note regarding the field exclusion and also added the reference link for the same.

- Audience Overview
- Audience Geo Location
- Audience Technology
- Acquisition Overview
- Behavior Overview
- Ecommerce Overview
## Configuration

This tap requires a `config.json` which specifies details regarding [OAuth 2.0](https://developers.google.com/analytics/devguides/reporting/core/v4/authorization#OAuth2Authorizing) authentication, a cutoff date for syncing historical data, and an optional flag which controls the method of authentication. See [config.sample.json](config.sample.json) for an example. You may specify an API key instead of OAuth parameters for development purposes, as detailed below.

To run the discover mode of `tap-google-analytics` with the configuration file, use this command:

```bash
$ tap-google-analytics -c my-config.json -d
```

To run the sync mode of `tap-google-analytics` with the catalog file, use the command:

```bash
$ tap-google-analytics -c my-config.json --catalog catalog.json
```

## Service Account Authentication

Service accounts are useful for automated, offline, or scheduled access to Google Analytics data for your own account. For example, to build a live dashboard of your own Google Analytics data and share it with other users.
See the [Google Analytics Service Accounts](https://developers.google.com/analytics/devguides/reporting/core/v4/authorization#service_accounts) section for more information on how to set up the service account.

To use an API key, include a `private_key` and `client_email` configuration variables in your `config.json` and set it to the value of your credentials.

---

Expand Down
13 changes: 13 additions & 0 deletions config.sample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"start_date": "2021-11-22T00:00:00Z",
"report_definitions": [
{
"id": "report_id",
"name": "Report Name"
}
],
"refresh_token": "my_token",
"client_id": "client_id",
"client_secret": "client_secret",
"auth_method": "oauth2"
}