Google AdSense

The Google AdSense Connector provides automated ingestion of revenue and impression reports.

Prerequisites

To configure access to the Google AdSense Connector, you need:

  • Google Service Account credential or a Google User credential
  • Account ID

Scheduling

The Google AdSense Connector can be scheduled to ingest data once per day at a user-defined hour and timezone. By default, the connector will run once at 6am PT. See Daily Scheduling for more information.


NOTE: Google AdSense reports have a row limit of 100,000 rows. If the report returns more rows than defined, Switchboard will display an error.


Parameters

Parameter

Description

Required/Optional?

account_id

string

Required

dimensions

A list of requested dimensions.

For dimensions descriptions, see Google’s AdSense Management API Reference Document.

At least one value is required.

metrics

A list of requested metrics.

For metrics descriptions, see Google’s AdSense Management API Reference Document.

At least one value is required.

Switchboard Script Syntax

import adsense_raw from {
   type: "adsense_ng";
   key: "google_token_key";
   account_id: "pub-12345";
   dimensions: ["DATE",
               "COUNTRY_NAME",
               "PLATFORM_TYPE_CODE",
               "URL_CHANNEL_NAME"];
   metrics: ["INDIVIDUAL_AD_IMPRESSIONS",
               "EARNINGS"];
   } using {
               date: datetime;
               country_name: string;
               platform_type_code: string;
               url_channel_name: string;
               individual_ad_impressions: integer;
               earnings: float;
   };