

# Google 広告に対する接続
<a name="connecting-to-googleads"></a>

 Google 広告 API は、Google 広告へのプログラムによるインターフェイスであり、大規模または複雑な Google 広告アカウントやキャンペーンの管理に使用されます。Google 広告ユーザーの場合は、AWS Glue を Google 広告アカウントに接続できます。その後、Google 広告を ETL ジョブのデータソースとして使用できます。これらのジョブを実行して、Google 広告と AWS サービス、またはその他のサポートされているアプリケーション間でデータを転送します。

**Topics**
+ [Google 広告用の AWS Glue サポート](googleads-support.md)
+ [接続を作成および使用するための API オペレーションを含むポリシー](googleads-configuring-iam-permissions.md)
+ [Google 広告の設定](googleads-configuring.md)
+ [Google 広告接続の設定](googleads-configuring-connections.md)
+ [Google 広告エンティティからの読み取り](googleads-reading-from-entities.md)
+ [Google 広告の接続オプション](googleads-connection-options.md)
+ [Google 広告アカウントの作成](googleads-create-account.md)
+ [制限](googleads-connector-limitations.md)

# Google 広告用の AWS Glue サポート
<a name="googleads-support"></a>

AWS Glue は次のように Google 広告をサポートします。

**ソースとしてサポートされていますか?**  
はい。AWS Glue ETL ジョブを使用し、Google 広告のデータをクエリできます。

**ターゲットとしてサポートされていますか?**  
いいえ。

**サポートされている Google 広告 の API バージョン**  
v18

# 接続を作成および使用するための API オペレーションを含むポリシー
<a name="googleads-configuring-iam-permissions"></a>

 次のサンプル ポリシーで、接続の作成と使用に必要な AWS の権限について説明します。新しいロールを作成する場合は、以下を含むポリシーを作成します。

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "glue:ListConnectionTypes",
        "glue:DescribeConnectionType",
        "glue:RefreshOAuth2Tokens",
        "glue:ListEntities",
        "glue:DescribeEntity"
      ],
      "Resource": "*"
    }
  ]
}
```

------

また、次のマネージド IAM ポリシーを使用して、アクセスを許可できます。
+  [ AWSGlueServiceRole ](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSGlueServiceRole) – さまざまな AWS Glue プロセスを実行するために必要なリソースへのアクセス権をユーザーに代わって付与します。これらのリソースには、AWS Glue、Amazon S3、IAM、CloudWatch Logs、および Amazon EC2 が含まれます。このポリシーで指定されたリソースの命名規則に従った場合、AWS Glue プロセスは必要なアクセス許可を使用できます。このポリシーは、通常、クローラー、ジョブ、開発エンドポイントを定義するときに指定されたロールにアタッチされます。
+  [ AWSGlueConsoleFullAccess ](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/AWSGlueConsoleFullAccess) — ポリシーがアタッチされているアイデンティティが AWS マネージメントコンソールを使用するときは、AWS Glue リソースへのフルアクセスを許可します。このポリシーで指定されたリソースの命名規則に従った場合、ユーザーは完全なコンソール機能を使用できます。このポリシーは、通常 AWS Glue コンソールのユーザーにアタッチされています。

# Google 広告の設定
<a name="googleads-configuring"></a>

AWS Glue を使用して Google 広告から転送できるようにするには、次の要件を満たす必要があります。

## 最小要件
<a name="googleads-configuring-min-requirements"></a>
+  E メールおよびパスワードが設定されている Google 広告アカウントを持っていること。アカウントの作成の詳細については、「[Google 広告アカウントの作成](googleads-create-account.md)」を参照してください。
+  Google 広告アカウントに API アクセスが有効になっていること。Google 広告 API の使用はすべて追加料金なしで利用できること。
+  Google 広告アカウントにより、接続されたアプリをインストールできること。この機能にアクセスできない場合、Google 広告の管理者にお問い合わせください。

 これらの要件を満たしている場合、AWS Glue を Google 広告のアカウントに接続する準備ができています。

# Google 広告接続の設定
<a name="googleads-configuring-connections"></a>

 Google 広告は OAuth2 の `AUTHORIZATION_CODE` グラントタイプをサポートしています。

 このグラントタイプは、ユーザーを認証するためにサードパーティーの認証サーバーにユーザーをリダイレクトすることから、「three-legged」の OAuth と見なされます。AWS Glue コンソール経由で接続を作成するときに使用されます。AWS Glue コンソールでは、ユーザーが Google 広告にリダイレクトされます。ここではユーザーがログインし、Google 広告インスタンスにアクセスするためのリクエストされた権限を AWS Glue に許可する必要があります。

 ユーザーは、Google 広告で独自の接続アプリを作成し、AWS Glue コンソールを介して接続を作成するときに独自のクライアント ID とクライアントシークレットを指定することを選択できます。このシナリオでは、引き続き Google 広告にリダイレクトされてログインし、リソースへアクセスするために AWS Glue を承認します。

 このグラントタイプは、更新トークンとアクセストークンになります。アクセストークンの有効期間は短く、更新トークンを使用してユーザーとやり取りすることなく自動的に更新される場合があります。

 詳細については、「[OAuth 認証コードフローでの接続されたアプリケーションの作成に関する Google 広告の公開ドキュメント](https://developers.google.com/workspace/guides/create-credentials)」を参照してください。

Google 広告の接続を設定するには:

1.  AWS Secrets Manager で、次の詳細を含むシークレットを作成します。AWS Glue で接続ごとにシークレットを作成する必要があります。

   1.  AuthorizationCode グラントタイプの場合: 
      +  カスタマーマネージド接続アプリケーションの場合 – シークレットには、`USER_MANAGED_CLIENT_APPLICATION_CLIENT_SECRET` を使用して接続されたアプリケーションのコンシューマーシークレットをキーとして含める必要があります。

1. AWS Glue Glue Studio で、以下の手順に従って **[データ接続]** の下に接続を作成します。

   1. **[接続タイプ]** を選択する際に、[Google 広告] を選択します。

   1. 接続先の Google 広告の `developer token` を指定します。

   1. マネージャーとしてログインする場合は、Google 広告の `MANAGER ID` を指定します。

   1.  AWS Glue が次のアクションを担い、その権限を持つことができる IAM ロールを選択します。

------
#### [ JSON ]

****  

      ```
      {
        "Version":"2012-10-17",		 	 	 
        "Statement": [
          {
            "Effect": "Allow",
            "Action": [
              "secretsmanager:DescribeSecret",
              "secretsmanager:GetSecretValue",
              "secretsmanager:PutSecretValue",
              "ec2:CreateNetworkInterface",
              "ec2:DescribeNetworkInterfaces",
              "ec2:DeleteNetworkInterface"
            ],
            "Resource": "*"
          }
        ]
      }
      ```

------

   1.  AWS Glue でこの接続に使用する `secretName` を選択して、トークンを配置します。

   1.  ネットワークを使用する場合は、ネットワークオプションを選択します。

1.  AWS Glue ジョブに関連付けられている IAM ロールに `secretName` を読み取るアクセス許可を付与します。

# Google 広告エンティティからの読み取り
<a name="googleads-reading-from-entities"></a>

 **前提条件** 
+  読み取り元の Google 広告オブジェクト。使用可能なエンティティを確認するには、以下のサポートされているエンティティの表を参照してください。

 **サポートされているエンティティ** 


| エンティティ | フィルタリング可能 | 制限をサポートする | Order By をサポートする | Select \$1 をサポートする | パーティション分割をサポートする | 
| --- | --- | --- | --- | --- | --- | 
| Ad Group Ad | はい | あり | あり | なし | あり | 
| Ad Group | はい | あり | あり | なし | あり | 
| Campaign Budget | はい | あり | あり | あり | あり | 
| Account Budget | あり | なし | あり | あり | なし | 
| キャンペーン | はい | あり | あり | あり | あり | 
| アカウント | あり | なし | あり | なし | なし | 

 **例** 

```
googleAds_read = glueContext.create_dynamic_frame.from_options(
    connection_type="googleads",
    connection_options={
        "connectionName": "connectionName",
        "ENTITY_NAME": "campaign-3467***",
        "API_VERSION": "v16"
    }
```

 **Google 広告エンティティとフィールドの詳細** 


| エンティティ | フィールド | データタイプ | サポートされている演算子 | 
| --- | --- | --- | --- | 
| アカウント | resourceName | 文字列 | \$1=, = | 
| アカウント | callReportingEnabled | ブール値 | \$1=, = | 
| アカウント | callConversionReportingEnabled | ブール値 | \$1=, = | 
| アカウント | callConversionAction | 文字列 | \$1=, = | 
| アカウント | conversionTrackingId | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| アカウント | crossAccountConversionTrackingId | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| アカウント | payPerConversionEligibilityFailureReasons | リスト |  | 
| アカウント | id | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| アカウント | currencyCode | 文字列 | \$1=, =, LIKE | 
| アカウント | timeZone | 文字列 | \$1=, =, LIKE | 
| アカウント | autoTaggingEnabled | ブール値 | \$1=, = | 
| アカウント | hasPartnersBadge | ブール値 | \$1=, = | 
| アカウント | manager | ブール値 | \$1=, = | 
| アカウント | testAccount | ブール値 | \$1=, = | 
| アカウント | date | 日付 | BETWEEN, =, <, >, <=, >= | 
| アカウント | costMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| アカウント | acceptedCustomerDataTerms | ブール値 |  | 
| アカウント | conversionTrackingStatus | 文字列 | \$1=, =, LIKE | 
| アカウント | enhancedConversionsForLeadsEnabled | ブール値 |  | 
| アカウント | googleAdsConversionCustomer | 文字列 |  | 
| アカウント | ステータス | 文字列 | \$1=, = | 
| アカウント | allConversionsByConversionDate | 倍精度 | \$1=, =, <, > | 
| アカウント | allConversionsValueByConversionDate | 倍精度 | \$1=, =, <, > | 
| アカウント | conversionsByConversionDate | 倍精度 | \$1=, =, <, > | 
| アカウント | conversionsValueByConversionDate | 倍精度 | \$1=, =, <, > | 
| アカウント | valuePerAllConversionsByConversionDate | 倍精度 | \$1=, =, <, > | 
| アカウント | videoViews | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| アカウント | clicks | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| アカウント | invalidClicks | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| アカウント | costPerAllConversions | 倍精度 | \$1=, =, <, > | 
| アカウント | costPerConversion | 倍精度 | \$1=, =, <, > | 
| アカウント | conversions | 倍精度 | \$1=, =, <, > | 
| アカウント | absoluteTopImpressionPercentage | 倍精度 | \$1=, =, <, > | 
| アカウント | IMPRESSION | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| アカウント | topImpressionPercentage | 倍精度 | \$1=, =, <, > | 
| アカウント | averageCpc | 倍精度 | \$1=, =, <, > | 
| アカウント | activeViewMeasurableCostMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| アカウント | averageCost | 倍精度 | \$1=, =, <, > | 
| アカウント | ctr | 倍精度 | \$1=, =, <, > | 
| アカウント | activeViewCtr | 倍精度 | \$1=, =, <, > | 
| アカウント | searchImpressionShare | 倍精度 | \$1=, =, <, > | 
| アカウント | conversionAction | 文字列 | \$1=, = | 
| アカウント | conversionActionCategory | 文字列 | \$1=, = | 
| アカウント | conversionActionName | 文字列 | \$1=, =, LIKE | 
| Account Budget | resourceName | 文字列 | \$1=, = | 
| Account Budget | ステータス | 文字列 | \$1=, = | 
| Account Budget | proposedEndTimeType | 文字列 | \$1=, = | 
| Account Budget | approvedEndTimeType | 文字列 | \$1=, = | 
| Account Budget | id | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Account Budget | billingSetup | 文字列 | \$1=, = | 
| Account Budget | 名前 | 文字列 | \$1=, =, LIKE | 
| Account Budget | approvedStartDateTime |  DateTime | BETWEEN, =, <, >, <=, >= | 
| Account Budget | proposedSpendingLimitMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Account Budget | approvedSpendingLimitMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Account Budget | adjustedSpendingLimitMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Account Budget | amountServedMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group | resourceName | 文字列 | \$1=, =, LIKE | 
| Ad Group | ステータス | 文字列 | \$1=, =, LIKE | 
| Ad Group | type | 文字列 | \$1=, =, LIKE | 
| Ad Group | id | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group | 名前 | 文字列 | \$1=, =, LIKE | 
| Ad Group | キャンペーン | 文字列 | \$1=, = | 
| Ad Group | cpcBidMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group | targetCpaMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group | cpmBidMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group | cpvBidMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group | targetCpmMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group | effectiveTargetCpaMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group | date | 日付 | BETWEEN, =, <, >, <=, >= | 
| Ad Group | costMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group | useAudienceGrouped | ブール値 | \$1=, = | 
| Ad Group | effectiveCpcBidMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group | allConversionsByConversionDate | 倍精度 | \$1=, =, <, > | 
| Ad Group | allConversionsValueByConversionDate | 倍精度 | \$1=, =, <, > | 
| Ad Group | conversionsByConversionDate | 倍精度 | \$1=, =, <, > | 
| Ad Group | conversionsValueByConversionDate | 倍精度 | \$1=, =, <, > | 
| Ad Group | valuePerAllConversionsByConversionDate | 倍精度 | \$1=, =, <, > | 
| Ad Group | valuePerConversionsByConversionDate | 倍精度 | \$1=, =, <, > | 
| Ad Group | averageCost | 倍精度 | \$1=, =, <, > | 
| Ad Group | costPerAllConversions | 倍精度 | \$1=, =, <, > | 
| Ad Group | costPerConversion | 倍精度 | \$1=, =, <, > | 
| Ad Group | averagePageViews | 倍精度 | \$1=, =, <, > | 
| Ad Group | videoViews | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group | clicks | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group | allConversions | 倍精度 | \$1=, =, <, > | 
| Ad Group | averageCpc | 倍精度 | \$1=, =, <, > | 
| Ad Group | absoluteTopImpressionPercentage | 倍精度 | \$1=, =, <, > | 
| Ad Group | IMPRESSION | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group | topImpressionPercentage | 倍精度 | \$1=, =, <, > | 
| Ad Group | activeViewCtr | 倍精度 | \$1=, =, <, > | 
| Ad Group | ctr | 倍精度 | \$1=, =, <, > | 
| Ad Group | searchTopImpressionShare | 倍精度 | \$1=, =, <, > | 
| Ad Group | searchImpressionShare | 倍精度 | \$1=, =, <, > | 
| Ad Group | searchAbsoluteTopImpressionShare | 倍精度 | \$1=, =, <, > | 
| Ad Group | relativeCtr | 倍精度 | \$1=, =, <, > | 
| Ad Group | conversionAction | 文字列 | \$1=, = | 
| Ad Group | conversionActionCategory | 文字列 | \$1=, = | 
| Ad Group | conversionActionName | 文字列 | \$1=, =, LIKE | 
| Ad Group | updateMask | 文字列 |  | 
| Ad Group | 作成 | Struct |  | 
| Ad Group | 更新 | Struct |  | 
| Ad Group | primaryStatus | 文字列 | \$1=, = | 
| Ad Group | primaryStatusReasons | リスト |  | 
| Ad Group Ad | resourceName | 文字列 | \$1=, = | 
| Ad Group Ad | id | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group Ad | ステータス | 文字列 | \$1=, = | 
| Ad Group Ad | ラベル | リスト |  | 
| Ad Group Ad | adGroup | 文字列 | \$1=, = | 
| Ad Group Ad | costMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group Ad | approvalStatus | 文字列 | \$1=, = | 
| Ad Group Ad | reviewStatus | 文字列 | \$1=, = | 
| Ad Group Ad | adStrength | 文字列 | \$1=, = | 
| Ad Group Ad | type | 文字列 | \$1=, = | 
| Ad Group Ad | businessName | 文字列 | \$1=, =, LIKE | 
| Ad Group Ad | date | 日付 | BETWEEN, =, <, >, <=, >= | 
| Ad Group Ad | allConversionsByConversionDate | 倍精度 | \$1=, =, <, > | 
| Ad Group Ad | allConversionsValueByConversionDate | 倍精度 | \$1=, =, <, > | 
| Ad Group Ad | conversionsByConversionDate | 倍精度 | \$1=, =, <, > | 
| Ad Group Ad | conversionsValueByConversionDate | 倍精度 | \$1=, =, <, > | 
| Ad Group Ad | valuePerAllConversionsByConversionDate | 倍精度 | \$1=, =, <, > | 
| Ad Group Ad | valuePerConversionsByConversionDate | 倍精度 | \$1=, =, <, > | 
| Ad Group Ad | activeViewMeasurableCostMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group Ad | averageCost | 倍精度 | \$1=, =, <, > | 
| Ad Group Ad | costPerAllConversions | 倍精度 | \$1=, =, <, > | 
| Ad Group Ad | costPerConversion | 倍精度 | \$1=, =, <, > | 
| Ad Group Ad | clicks | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group Ad | averagePageViews | 倍精度 | \$1=, =, <, > | 
| Ad Group Ad | videoViews | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group Ad | allConversions | 倍精度 | \$1=, =, <, > | 
| Ad Group Ad | averageCpc | 倍精度 | \$1=, =, <, > | 
| Ad Group Ad | topImpressionPercentage | 倍精度 | \$1=, =, <, > | 
| Ad Group Ad | IMPRESSION | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group Ad | absoluteTopImpressionPercentage | 倍精度 | \$1=, =, <, > | 
| Ad Group Ad | activeViewCtr | 倍精度 | \$1=, =, <, > | 
| Ad Group Ad | ctr | 倍精度 | \$1=, =, <, > | 
| Ad Group Ad | conversionAction | 文字列 | \$1=, = | 
| Ad Group Ad | conversionActionCategory | 文字列 | \$1=, = | 
| Ad Group Ad | conversionActionName | 文字列 | \$1=, =, LIKE | 
| Ad Group Ad | updateMask | 文字列 |  | 
| Ad Group Ad | 作成 | Struct |  | 
| Ad Group Ad | 更新 | Struct |  | 
| Ad Group Ad | policyValidationParameter | Struct |  | 
| Ad Group Ad | primaryStatus | 文字列 | \$1=, = | 
| Ad Group Ad | primaryStatusReasons | リスト |  | 
| キャンペーン | resourceName | 文字列 | \$1=, = | 
| キャンペーン | ステータス | 文字列 | \$1=, = | 
| キャンペーン | baseCampaign | 文字列 | \$1=, = | 
| キャンペーン | 名前 | 文字列 | \$1=, =, LIKE | 
| キャンペーン | id | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| キャンペーン | campaignBudget | 文字列 | \$1=, =, LIKE | 
| キャンペーン | startDate | 日付 | BETWEEN, =, <, >, <=, >= | 
| キャンペーン | endDate | 日付 | BETWEEN, =, <, >, <=, >= | 
| キャンペーン | adServingOptimizationStatus | 文字列 | \$1=, = | 
| キャンペーン | advertisingChannelType | 文字列 | \$1=, = | 
| キャンペーン | advertisingChannelSubType | 文字列 | \$1=, = | 
| キャンペーン | experimentType | 文字列 | \$1=, = | 
| キャンペーン | servingStatus | 文字列 | \$1=, = | 
| キャンペーン | biddingStrategyType | 文字列 | \$1=, = | 
| キャンペーン | domainName | 文字列 | \$1=, =, LIKE | 
| キャンペーン | languageCode | 文字列 | \$1=, =, LIKE | 
| キャンペーン | useSuppliedUrlsOnly | ブール値 | \$1=, = | 
| キャンペーン | positiveGeoTargetType | 文字列 | \$1=, = | 
| キャンペーン | negativeGeoTargetType | 文字列 | \$1=, = | 
| キャンペーン | paymentMode | 文字列 | \$1=, = | 
| キャンペーン | optimizationGoalTypes | リスト |  | 
| キャンペーン | date | 日付 | BETWEEN, =, <, >, <=, >= | 
| キャンペーン | averageCost | 倍精度 |  | 
| キャンペーン | clicks | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| キャンペーン | costMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| キャンペーン | IMPRESSION | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| キャンペーン | useAudienceGrouped | ブール値 | \$1=, = | 
| キャンペーン | activeViewMeasurableCostMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| キャンペーン | costPerAllConversions | 倍精度 | \$1=, =, <, > | 
| キャンペーン | costPerConversion | 倍精度 | \$1=, =, <, > | 
| キャンペーン | invalidClicks | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| キャンペーン | publisherPurchasedClicks | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| キャンペーン | averagePageViews | 倍精度 | \$1=, =, <, > | 
| キャンペーン | videoViews | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| キャンペーン | allConversionsByConversionDate | 倍精度 | \$1=, =, <, > | 
| キャンペーン | allConversionsValueByConversionDate | 倍精度 | \$1=, =, <, > | 
| キャンペーン | conversionsByConversionDate | 倍精度 | \$1=, =, <, > | 
| キャンペーン | conversionsValueByConversionDate | 倍精度 | \$1=, =, <, > | 
| キャンペーン | valuePerAllConversionsByConversionDate | 倍精度 | \$1=, =, <, > | 
| キャンペーン | valuePerConversionsByConversionDate | 倍精度 | \$1=, =, <, > | 
| キャンペーン | allConversions | 倍精度 | \$1=, =, <, > | 
| キャンペーン | absoluteTopImpressionPercentage | 倍精度 | \$1=, =, <, > | 
| キャンペーン | searchAbsoluteTopImpressionShare | 倍精度 | \$1=, =, <, > | 
| キャンペーン | averageCpc | 倍精度 | \$1=, =, <, > | 
| キャンペーン | searchImpressionShare | 倍精度 | \$1=, =, <, > | 
| キャンペーン | searchTopImpressionShare | 倍精度 | \$1=, =, <, > | 
| キャンペーン | activeViewCtr | 倍精度 | \$1=, =, <, > | 
| キャンペーン | ctr | 倍精度 | \$1=, =, <, > | 
| キャンペーン | relativeCtr | 倍精度 | \$1=, =, <, > | 
| キャンペーン | updateMask | 文字列 |  | 
| キャンペーン | 作成 | Struct |  | 
| キャンペーン | 更新 | Struct |  | 
| Campaign Budget | resourceName | 文字列 | \$1=, = | 
| Campaign Budget | id | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Campaign Budget | ステータス | 文字列 | \$1=, = | 
| Campaign Budget | deliveryMethod | 文字列 | \$1=, = | 
| Campaign Budget | 期間 | 文字列 | \$1=, = | 
| Campaign Budget | type | 文字列 | \$1=, = | 
| Campaign Budget | 名前 | 文字列 | \$1=, =, LIKE | 
| Campaign Budget | amountMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Campaign Budget | explicitlyShared | ブール値 | \$1=, = | 
| Campaign Budget | referenceCount | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Campaign Budget | hasRecommendedBudget | ブール値 | \$1=, = | 
| Campaign Budget | date | 日付 | BETWEEN, =, <, >, <=, >= | 
| Campaign Budget | costMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Campaign Budget | startDate | 日付 | BETWEEN, =, <, >, <=, >= | 
| Campaign Budget | endDate | 日付 | BETWEEN, =, <, >, <=, >= | 
| Campaign Budget | maximizeConversionValueTargetRoas | 倍精度 | \$1=, =, <, > | 
| Campaign Budget | maximizeConversionsTargetCpaMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Campaign Budget | selectiveOptimizationConversionActions | 文字列 |  | 
| Campaign Budget | averageCost | 倍精度 | \$1=, =, <, > | 
| Campaign Budget | costPerAllConversions | 倍精度 | \$1=, =, <, > | 
| Campaign Budget | costPerConversion | 倍精度 | \$1=, =, <, > | 
| Campaign Budget | videoViews | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Campaign Budget | clicks | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Campaign Budget | allConversions | 倍精度 | \$1=, =, <, > | 
| Campaign Budget | valuePerAllConversions | 倍精度 | \$1=, =, <, > | 
| Campaign Budget | averageCpc | 倍精度 | \$1=, =, <, > | 
| Campaign Budget | IMPRESSION | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Campaign Budget | ctr | 倍精度 | \$1=, =, <, > | 
| Campaign Budget | updateMask | 文字列 |  | 
| Campaign Budget | 作成 | Struct |  | 
| Campaign Budget | 更新 | Struct |  | 

 **パーティショニングクエリ** 

 Spark で同時実行を使用する場合は、追加の Spark オプション `PARTITION_FIELD`、`LOWER_BOUND`、`UPPER_BOUND`、および `NUM_PARTITIONS` を指定できます。これらのパラメータを使用すると、元のクエリは Spark タスクで同時に実行できるサブクエリの `NUM_PARTITIONS` の数に分割されます。
+  `PARTITION_FIELD`: クエリのパーティション化に使用するフィールドの名前。
+  `LOWER_BOUND`: 選択したパーティションフィールドの包括的な下限値。

   日付については、Spark SQL クエリで使用される Spark の日付形式を受け入れます。有効な値の例: `"2024-02-06"`。
+  `UPPER_BOUND`: 選択したパーティションフィールドの排他的上限値。
+  `NUM_PARTITIONS`: パーティション数。

 エンティティごとのパーティション分割フィールドのサポートの詳細は、次の表にまとめられています。


| エンティティ名 | Partitioning Field | データタイプ | 
| --- | --- | --- | 
| Ad Group Ad | date | 日付 | 
| Ad Group | date | 日付 | 
| キャンペーン | date | 日付 | 
| Campaign Budget | date | 日付 | 

 **例** 

```
googleads_read = glueContext.create_dynamic_frame.from_options(
    connection_type="googleads",
    connection_options={
        "connectionName": "connectionName",
        "ENTITY_NAME": "campaign-3467***",
        "API_VERSION": "v16",
        "PARTITION_FIELD": "date"
        "LOWER_BOUND": "2024-01-01"
        "UPPER_BOUND": "2024-06-05"
        "NUM_PARTITIONS": "10"
    }
)
```

# Google 広告の接続オプション
<a name="googleads-connection-options"></a>

Google 広告の接続オプションは次のとおりです。
+  `ENTITY_NAME`(文字列) – (必須) 読み取り / 書き込みに使用されます。Google 広告内のオブジェクトの名前。
+  `API_VERSION`(文字列) – (必須) 読み取り / 書き込みに使用されます。使用する Google 広告の Rest API バージョン。例: v16。
+  `DEVELOPER_TOKEN`(文字列) – (必須) 読み取り / 書き込みに使用されます。API にリクエストを行う開発者またはアプリケーションを認証するために必要です。
+  `MANAGER_ID`(文字列) – 読み取り / 書き込みに使用されます。複数の Google 広告アカウントを管理できる一意の識別子。これは、承認されたマネージャーの顧客 ID です。顧客アカウントへのアクセスがマネージャーアカウント経由である場合は、`MANAGER_ID` が必要です。詳細については、「[login-customer-id](https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid)」を参照してください。
+  `SELECTED_FIELDS`(List<String>) – Default: empty(SELECT \$1). 読み込みに使用されます。オブジェクトに選択する列です。
+  `FILTER_PREDICATE`(文字列) – デフォルト: 空 読み込みに使用されます。Spark SQL 形式である必要があります。
+  `QUERY`(文字列) - デフォルト: 空 読み込みに使用されます。完全な Spark SQL クエリです。
+  `PARTITION_FIELD`(文字列) - 読み取りに使用されます。クエリをパーティション化するために使用するフィールドです。
+  `LOWER_BOUND`(文字列) - 読み取りに使用されます。選択したパーティションフィールドの包括的な下限値。
+  `UPPER_BOUND` (文字列) - 読み取りに使用されます。選択したパーティションフィールドの排他的上限値。
+  `NUM_PARTITIONS`(整数) – デフォルト: 1。読み込みに使用されます。読み取り用のパーティションの数です。

# Google 広告アカウントの作成
<a name="googleads-create-account"></a>

1.  認証情報を使用して、[Google 広告の開発者アカウント](https://console.cloud.google.com)にログインして、\$1MyProject に移動します。  
![\[スクリーンショットには、Google 広告の開発者アカウントにログインするためのウェルカム画面が示されています。\]](http://docs.aws.amazon.com/ja_jp/glue/latest/dg/images/google-ads-log-in-developer-account.png)

1.  登録済みのアプリケーションがない場合、**[新規プロジェクト]** を選択し Google プロジェクトの作成に必要な情報を入力します。  
![\[スクリーンショットには、プロジェクトページの選択が示されています。右上隅の [新規プロジェクト] を選択します。\]](http://docs.aws.amazon.com/ja_jp/glue/latest/dg/images/google-ads-new-project.png)  
![\[スクリーンショットには、プロジェクト名を入力して場所を選択するため、[新規プロジェクト] ウィンドウが示されています。\]](http://docs.aws.amazon.com/ja_jp/glue/latest/dg/images/google-ads-new-project-name-location.png)

1.  **[ナビゲーションタブ]** および **[API と設定]** を選択したら、**[クライアント ID を作成]** に加え、AWS Glue と GoogleAds の間に関連付けするために追加の設定が必要となる **[ClientSecret]** を選択します。詳細については、「[API 認証情報](https://console.cloud.google.com/apis/credentials)」を参照してください。  
![\[スクリーンショットには、API およびサービスの設定ページが示されています。\]](http://docs.aws.amazon.com/ja_jp/glue/latest/dg/images/google-ads-apis-and-services.png)

1.  **[認証情報を作成]** を選択したら、**[OAuth クライアント ID]** を選択します。  
![\[スクリーンショットには、[認証情報を作成] ドロップダウンおよび [Oauth クライアント ID] オプションが強調表示された API とサービスの設定ページが示されています。\]](http://docs.aws.amazon.com/ja_jp/glue/latest/dg/images/google-ads-create-credentials.png)

1.  **[アプリケーションタイプ]** を **[ウェブアプリケーション]** として選択します。  
![\[スクリーンショットには、ウェブアプリケーションとして OAuth クライアント ID の作成ページおよびアプリケーションタイプが示されています。\]](http://docs.aws.amazon.com/ja_jp/glue/latest/dg/images/google-ads-oauth-client-id-application-type.png)

1.  **[認可されたリダイレクト URI]** で、OAuth リダイレクト URI を追加して **[作成]** を選択します。必要に応じて複数のリダイレクト URI を追加できます。  
![\[このスクリーンショットは、[OAuth クライアント ID の作成] ページと [認可されたリダイレクト URI] セクションを示しています。ここでは、URI を追加し、必要に応じて [ADD URI] を選択します。完了したら、[作成] を選択します。\]](http://docs.aws.amazon.com/ja_jp/glue/latest/dg/images/google-ads-oauth-redirect-uris.png)

1.  **[クライアントID]** および **[クライアントシークレット]** は、AWS Glue と Google 広告の間に関連付けするときに生成されます。  
![\[このスクリーンショットは、[OAuth クライアント ID の作成] ページと [認可されたリダイレクト URI] セクションを示しています。ここでは、URI を追加し、必要に応じて [ADD URI] を選択します。完了したら、[作成] を選択します。\]](http://docs.aws.amazon.com/ja_jp/glue/latest/dg/images/google-ads-oauth-client-created.png)

1.  アプリケーションのニーズに応じてスコープを追加し、**[OAuth 同意画面]** を選択して必要な情報を指定したら、要件に基づいてスコープを追加します。  
![\[スクリーンショットには、[更新情報] の選択されたスコープページが示されています。必要に応じてスコープを選択します。\]](http://docs.aws.amazon.com/ja_jp/glue/latest/dg/images/google-ads-selected-scopes.png)

# 制限
<a name="googleads-connector-limitations"></a>

Google 広告コネクタの制限は次のとおりです:
+ `MANAGER_ID` は、接続を作成するときのオプションの入力です。ただし、特定のマネージャーの基盤となる顧客にアクセスする場合、`MANAGER_ID` は必須の入力です。以下の表では、`MANAGER_ID` が接続に含まれるかどうかに基づくアクセス制限について説明します。    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/glue/latest/dg/googleads-connector-limitations.html)
+ マネージャーアカウントがオブジェクトとして選択されると、`Account` のみがサブオブジェクトとして表示されます。Google 広告コネクタでは、キャンペーン、広告などのエンティティは、マネージャーアカウントではなく個々のクライアントアカウントに基づいて取得されます。
+ マネージャーアカウントのメトリクスを取得することはできません。代わりに、個々のクライアントアカウントのメトリクスを取得できます。
+  各アカウントには、アクティブなキャンペーンと一時停止されたキャンペーンの両方を含め、最大 10,000 のキャンペーンを設定できます。詳細については、「[アカウントあたりのキャンペーン](https://support.google.com/google-ads/answer/6372658)」を参照してください。
+  レポートを作成するときに、表示する特定のメトリクスを選択した場合、選択したメトリクスがすべてゼロである行は返されません。詳細については、「[ゼロメトリクス](https://developers.google.com/google-ads/api/docs/reporting/zero-metrics?hl=en#exclude_zero_metrics_by_segmenting)」を参照してください。
+  以下のフィールドでは、フルマッピングフローは、アカウント、広告グループや広告グループ広告エンティティ、特に conversionAction、conversionActionCategory、conversionActionName では機能しません。詳細については、「[セグメントとメトリクス](https://developers.google.com/google-ads/api/docs/reporting/segmentation?hl=en#selectability_between_segments_and_metrics)」を参照してください。
+ `segments.date` フィールドが選択されている場合、日付範囲フィルターは必須です。