iBet uBet web content aggregator. Adding the entire web to your favor.
iBet uBet web content aggregator. Adding the entire web to your favor.



Link to original content: http://github.com/performax-cz/keboola-ex-google-ad-manager-report-service
GitHub - performax-cz/keboola-ex-google-ad-manager-report-service: Extractor for downloading reports from Google Ad Manager API
Skip to content

performax-cz/keboola-ex-google-ad-manager-report-service

Repository files navigation

GAM Report Service Extractor for KBC

Extractor for downloading reports from Google Ad Manager API. It executes a ReportJob and retrieves performance and statistics about ad campaigns, networks, inventory and sales. It uses ReportService.ReportQuery endpoint.

⚙️ Configuration

  • date_from and date_to (REQUIRED) - Period which the reporting information is gathered, e.g. 4 days ago, yeserday, August 14, 2020 EST (it uses dateparser)
  • network_code (REQUIRED) - You'll find this in the URL when you are logged into your network. For example, in the URL https://admanager.google.com/1234#home, 1234 is your network code.
  • timezone (REQUIRED) - Determines the time zone used for the report's date range. It allows AD_EXCHANGE, PUBLISHER and PROPOSAL_LOCAL
  • #private_key (REQUIRED) - Credentials - private key in plain text (will be encrypted by Keboola). Key must be written in one row, each new line must be delimited by \n character
  • #client_email and token_uri (REQUIRED) - Credentials
  • dimensions (OPTIONAL) - The list of break-down types being requested in the report. It defaults to AD_EXCHANGE_DFP_AD_UNIT, AD_EXCHANGE_PRICING_RULE_NAME and DATE (or AD_EXCHANGE_DATE if timezone is AD_EXCHANGE)
  • dimension_attributes (OPTIONAL) - The list of dimension attributes. Please note, that some dimension attributes can be used only with certain dimension. For more information please see the official documentation. dimension_attributes are not used by default
  • metrics (OPTIONAL) - The list of trafficking statistics and revenue information being requested in the report. It defaults to AD_EXCHANGE_AD_REQUESTS, AD_EXCHANGE_MATCHED_REQUESTS, AD_EXCHANGE_ESTIMATED_REVENUE and AD_EXCHANGE_IMPRESSIONS
  • currency (OPTIONAL) - The currency for Ad Exchange revenue metrics. It defaults to `CZK
  • ad_unit_view (OPTIONAL) - The adUnitView used for report

🔖 Sample configuration

{
  "date_from": "80 days ago",
  "date_to": "yesterday",
  "network_code": "68713940014",
  "timezone": "AD_EXCHANGE",
  "#private_key": "KBC::ProjectSecure::eJwB1Qcq...OVNcF",
  "#client_email": "KBC::ProjectSecure::eJwBYQGeE...iKz=",
  "token_uri": "https://oauth2.googleapis.com/token",
  "dimensions": [
    "AD_EXCHANGE_DATE",
    "AD_EXCHANGE_DFP_AD_UNIT",
    "AD_EXCHANGE_DFP_AD_UNIT_ID",
    "AD_EXCHANGE_PRICING_RULE_NAME"
  ],
  "metrics": [
    "AD_EXCHANGE_AD_REQUESTS",
    "AD_EXCHANGE_MATCHED_REQUESTS",
    "AD_EXCHANGE_ESTIMATED_REVENUE",
    "AD_EXCHANGE_IMPRESSIONS"
  ]
}

Please note, that you must replace #private_key and #client_email with your real credentials.

🔓 How to get credentials and enable API access

  1. Create a new service account and download JSON file with credentials
  2. Enable API in General settings of Google Ad Manager client

More details: https://developers.google.com/ad-manager/api/start

🧑‍💻 Development

  1. Set your own config file config/config.json (use template in config/config.template.json)
  2. Install Docker and Docker Compose and run it by docker-compose up
  3. Output CSV file is in output directory

❤️ Prepared by Performax

In case of any problems with the extractor or additional requests, contact us on development@performax.cz