<commit_before># adwords-extractor
KBC Docker app for extracting data from Google AdWords

The Extractor gets list of accessible clients, list of their campaigns and defined AWQL queries for given date range and saves the data to Storage API.

## Status

[![Build Status](https://travis-ci.org/keboola/adwords-extractor.svg)](https://travis-ci.org/keboola/adwords-extractor) [![Code Climate](https://codeclimate.com/github/keboola/adwords-extractor/badges/gpa.svg)](https://codeclimate.com/github/keboola/adwords-extractor) [![Test Coverage](https://codeclimate.com/github/keboola/adwords-extractor/badges/coverage.svg)](https://codeclimate.com/github/keboola/adwords-extractor/coverage)

## Access Tokens
You have to apply for AdWords Developer Token in your MCC, see [https://developers.google.com/adwords/api/docs/signingup#step2a]

Once you get the Developer Token you can request Refresh Token using our website: https://syrup.keboola.com/ex-adwords/token

## Configuration

- **parameters**:
    - **developer_token** - Your developer token
    - **refresh_token** - Generated refresh token
    - **customer_id** - Instructions to get it are here: https://support.google.com/adwords/answer/1704344?hl=en
    - **bucket** - Name of bucket where the data will be saved
    - **since** *(optional)* - start date of downloaded stats (default is "-1 day")
    - **until** *(optional)* - end date of downloaded stats (default is "-1 day")
    - **reports** - Array of reports to download as Ad-hoc report, each item must contain:
        - **name** - Name of query, data will be saved to table `[bucket].report-[name]`
        - **query** - AWQL query for downloading Ad-hoc report (see [https://developers.google.com/adwords/api/docs/guides/awql]). You should pick columns to download from allowed report values and FROM clause from allowed report types
        - **primary** - Array of columns to be used as primary key

Example:
```
{
    "parameters": {<commit_msg>docs: fix refresh token docs<commit_after># adwords-extractor
KBC Docker app for extracting data from Google AdWords

The Extractor gets list of accessible clients, list of their campaigns and defined AWQL queries for given date range and saves the data to Storage API.

## Status

[![Build Status](https://travis-ci.org/keboola/adwords-extractor.svg)](https://travis-ci.org/keboola/adwords-extractor) [![Code Climate](https://codeclimate.com/github/keboola/adwords-extractor/badges/gpa.svg)](https://codeclimate.com/github/keboola/adwords-extractor) [![Test Coverage](https://codeclimate.com/github/keboola/adwords-extractor/badges/coverage.svg)](https://codeclimate.com/github/keboola/adwords-extractor/coverage)

## Access Tokens
You have to apply for AdWords Developer Token in your MCC, see [https://developers.google.com/adwords/api/docs/signingup#step2a]

Once you get the Developer Token you can request Refresh Token using extractor's UI in Keboola or directly using API call `https://syrup.keboola.com/oauth/auth20?api=ex-adwords&token={storage_api_token}&id={your_custom_id}` (see docs for more information: [http://docs.oauth9.apiary.io/#reference/api/generate-oauth-token-for-oauth-10-applications/generate-token-manually])

## Configuration

- **parameters**:
    - **developer_token** - Your developer token
    - **refresh_token** - Generated refresh token
    - **customer_id** - Instructions to get it are here: https://support.google.com/adwords/answer/1704344?hl=en
    - **bucket** - Name of bucket where the data will be saved
    - **since** *(optional)* - start date of downloaded stats (default is "-1 day")
    - **until** *(optional)* - end date of downloaded stats (default is "-1 day")
    - **reports** - Array of reports to download as Ad-hoc report, each item must contain:
        - **name** - Name of query, data will be saved to table `[bucket].report-[name]`
        - **query** - AWQL query for downloading Ad-hoc report (see [https://developers.google.com/adwords/api/docs/guides/awql]). You should pick columns to download from allowed report values and FROM clause from allowed report types
        - **primary** - Array of columns to be used as primary key

Example:
```
{
    "parameters": {
{'fraction_non_alphanumeric': 0.12779628748215136, 'fraction_numerical': 0.005949547834364588, 'mean_word_length': 4.195302843016069, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 20, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '846605', 'n_tokens_mistral': 1287, 'n_tokens_neox': 1234, 'n_words': 389}