

# Connecting to Google Ads
<a name="connecting-to-googleads"></a>

 The Google Ads API is the programmatic interface to Google Ads, used for managing large or complex Google Ads accounts and campaigns. If you're a Google Ads user, you can connect AWS Glue to your Google Ads account. Then, you can use Google Ads as a data source in your ETL jobs. Run these jobs to transfer data between Google Ads and AWS services or other supported applications. 

**Topics**
+ [AWS Glue support for Google Ads](googleads-support.md)
+ [Policies containing the API operations for creating and using connections](googleads-configuring-iam-permissions.md)
+ [Configuring Google Ads](googleads-configuring.md)
+ [Configuring Google Ads connections](googleads-configuring-connections.md)
+ [Reading from Google Ads entities](googleads-reading-from-entities.md)
+ [Google Ads connection options](googleads-connection-options.md)
+ [Creating a Google Ads account](googleads-create-account.md)
+ [Limitations](googleads-connector-limitations.md)

# AWS Glue support for Google Ads
<a name="googleads-support"></a>

AWS Glue supports Google Ads as follows:

**Supported as a source?**  
Yes. You can use AWS Glue ETL jobs to query data from Google Ads.

**Supported as a target?**  
No.

**Supported Google Ads API versions**  
v18

# Policies containing the API operations for creating and using connections
<a name="googleads-configuring-iam-permissions"></a>

 The following sample policy describes the required AWS permissions for creating and using connections. If you are creating a new role, create a policy that contains the following: 

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

****  

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

------

You can also use the following managed IAM policies to allow access:
+  [ AWSGlueServiceRole ](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSGlueServiceRole) – Grants access to resources that various AWS Glue processes require to run on your behalf. These resources include AWS Glue, Amazon S3, IAM, CloudWatch Logs, and Amazon EC2. If you follow the naming convention for resources specified in this policy, AWS Glue processes have the required permissions. This policy is typically attached to roles specified when defining crawlers, jobs, and development endpoints. 
+  [ AWSGlueConsoleFullAccess ](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/AWSGlueConsoleFullAccess) – Grants full access to AWS Glue resources when an identity that the policy is attached to uses the AWS Management Console. If you follow the naming convention for resources specified in this policy, users have full console capabilities. This policy is typically attached to users of the AWS Glue console. 

# Configuring Google Ads
<a name="googleads-configuring"></a>

Before you can use AWS Glue to transfer from Google Ads, you must meet these requirements:

## Minimum requirements
<a name="googleads-configuring-min-requirements"></a>
+  You have a Google Ads account with Email and Password. For more information on creating an account, see [Creating a Google Ads account](googleads-create-account.md). 
+  Your Google Ads account is enabled for API access. All use of the Google Ads API is available at no additional cost. 
+  Your Google Ads account allows you to install connected apps. If you lack access to this functionality, contact your Google Ads administrator. 

 If you meet these requirements, you’re ready to connect AWS Glue to your Google Ads account. 

# Configuring Google Ads connections
<a name="googleads-configuring-connections"></a>

 Google Ads supports `AUTHORIZATION_CODE` grant type for OAuth2. 

 This grant type is considered “three-legged” OAuth as it relies on redirecting users to the third party authorization server to authenticate the user. It is used when creating connections via the AWS Glue Console. The AWS Glue Console will redirect the user to Google Ads where the user must login and allow AWS Glue the requested permissions to access their Google Ads instance. 

 Users may opt to create their own connected app in Google Ads and provide their own client ID and client secret when creating connections through the AWS Glue Console. In this scenario, they will still be redirected to Google Ads to login and authorize AWS Glue to access their resources. 

 This grant type results in a refresh token and access token. The access token is short lived, and may be refreshed automatically without user interaction using the refresh token. 

 For more information, see [ public Google Ads documentation on creating a connected app for Authorization Code OAuth flow ](https://developers.google.com/workspace/guides/create-credentials). 

To configure a Google Ads connection:

1.  In AWS Secrets Manager, create a secret with the following details. It is required to create a secret for each connection in AWS Glue. 

   1.  For AuthorizationCode grant type: 
      +  For customer managed connected app – Secret should contain the connected app Consumer Secret with `USER_MANAGED_CLIENT_APPLICATION_CLIENT_SECRET` as key. 

1. In AWS Glue Glue Studio, create a connection under **Data Connections** by following the steps below: 

   1. When selecting a **Connection type**, select Google Ads.

   1. Provide the `developer token` of the Google Ads you want to connect to.

   1. Provide the `MANAGER ID` of the Google Ads if you want to log in as manager.

   1.  Select the IAM role which AWS Glue can assume and has permissions for following actions: 

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

****  

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

------

   1.  Select the `secretName` which you want to use for this connection in AWS Glue to put the tokens. 

   1.  Select the network options if you want to use your network. 

1.  Grant the IAM role associated with your AWS Glue job permission to read `secretName`. 

# Reading from Google Ads entities
<a name="googleads-reading-from-entities"></a>

 **Prerequisites** 
+  A Google Ads Object you would like to read from. Refer the supported entities table below to check the available entities. 

 **Supported entities** 


| Entity | Can be Filtered | Supports Limit | Supports Order By | Supports Select \$1 | Supports Partitioning | 
| --- | --- | --- | --- | --- | --- | 
| Ad Group Ad | Yes | Yes | Yes | No | Yes | 
| Ad Group | Yes | Yes | Yes | No | Yes | 
| Campaign Budget | Yes | Yes | Yes | Yes | Yes | 
| Account Budget | Yes | No | Yes | Yes | No | 
| Campaign | Yes | Yes | Yes | Yes | Yes | 
| Account | Yes | No | Yes | No | No | 

 **Example** 

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

 **Google Ads entity and field details** 


| Entity | Field | Data Type | Supported Operators | 
| --- | --- | --- | --- | 
| Account | resourceName | String | \$1=, = | 
| Account | callReportingEnabled | Boolean | \$1=, = | 
| Account | callConversionReportingEnabled | Boolean | \$1=, = | 
| Account | callConversionAction | String | \$1=, = | 
| Account | conversionTrackingId | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Account | crossAccountConversionTrackingId | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Account | payPerConversionEligibilityFailureReasons | List |  | 
| Account | id | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Account | currencyCode | String | \$1=, =, LIKE | 
| Account | timeZone | String | \$1=, =, LIKE | 
| Account | autoTaggingEnabled | Boolean | \$1=, = | 
| Account | hasPartnersBadge | Boolean | \$1=, = | 
| Account | manager | Boolean | \$1=, = | 
| Account | testAccount | Boolean | \$1=, = | 
| Account | date | Date | BETWEEN, =, <, >, <=, >= | 
| Account | costMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Account | acceptedCustomerDataTerms | Boolean |  | 
| Account | conversionTrackingStatus | String | \$1=, =, LIKE | 
| Account | enhancedConversionsForLeadsEnabled | Boolean |  | 
| Account | googleAdsConversionCustomer | String |  | 
| Account | status | String | \$1=, = | 
| Account | allConversionsByConversionDate | Double | \$1=, =, <, > | 
| Account | allConversionsValueByConversionDate | Double | \$1=, =, <, > | 
| Account | conversionsByConversionDate | Double | \$1=, =, <, > | 
| Account | conversionsValueByConversionDate | Double | \$1=, =, <, > | 
| Account | valuePerAllConversionsByConversionDate | Double | \$1=, =, <, > | 
| Account | videoViews | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Account | clicks | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Account | invalidClicks | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Account | costPerAllConversions | Double | \$1=, =, <, > | 
| Account | costPerConversion | Double | \$1=, =, <, > | 
| Account | conversions | Double | \$1=, =, <, > | 
| Account | absoluteTopImpressionPercentage | Double | \$1=, =, <, > | 
| Account | impressions | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Account | topImpressionPercentage | Double | \$1=, =, <, > | 
| Account | averageCpc | Double | \$1=, =, <, > | 
| Account | activeViewMeasurableCostMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Account | averageCost | Double | \$1=, =, <, > | 
| Account | ctr | Double | \$1=, =, <, > | 
| Account | activeViewCtr | Double | \$1=, =, <, > | 
| Account | searchImpressionShare | Double | \$1=, =, <, > | 
| Account | conversionAction | String | \$1=, = | 
| Account | conversionActionCategory | String | \$1=, = | 
| Account | conversionActionName | String | \$1=, =, LIKE | 
| Account Budget | resourceName | String | \$1=, = | 
| Account Budget | status | String | \$1=, = | 
| Account Budget | proposedEndTimeType | String | \$1=, = | 
| Account Budget | approvedEndTimeType | String | \$1=, = | 
| Account Budget | id | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Account Budget | billingSetup | String | \$1=, = | 
| Account Budget | name | String | \$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 | String | \$1=, =, LIKE | 
| Ad Group | status | String | \$1=, =, LIKE | 
| Ad Group | type | String | \$1=, =, LIKE | 
| Ad Group | id | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group | name | String | \$1=, =, LIKE | 
| Ad Group | campaign | String | \$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 | Date | BETWEEN, =, <, >, <=, >= | 
| Ad Group | costMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group | useAudienceGrouped | Boolean | \$1=, = | 
| Ad Group | effectiveCpcBidMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group | allConversionsByConversionDate | Double | \$1=, =, <, > | 
| Ad Group | allConversionsValueByConversionDate | Double | \$1=, =, <, > | 
| Ad Group | conversionsByConversionDate | Double | \$1=, =, <, > | 
| Ad Group | conversionsValueByConversionDate | Double | \$1=, =, <, > | 
| Ad Group | valuePerAllConversionsByConversionDate | Double | \$1=, =, <, > | 
| Ad Group | valuePerConversionsByConversionDate | Double | \$1=, =, <, > | 
| Ad Group | averageCost | Double | \$1=, =, <, > | 
| Ad Group | costPerAllConversions | Double | \$1=, =, <, > | 
| Ad Group | costPerConversion | Double | \$1=, =, <, > | 
| Ad Group | averagePageViews | Double | \$1=, =, <, > | 
| Ad Group | videoViews | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group | clicks | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group | allConversions | Double | \$1=, =, <, > | 
| Ad Group | averageCpc | Double | \$1=, =, <, > | 
| Ad Group | absoluteTopImpressionPercentage | Double | \$1=, =, <, > | 
| Ad Group | impressions | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group | topImpressionPercentage | Double | \$1=, =, <, > | 
| Ad Group | activeViewCtr | Double | \$1=, =, <, > | 
| Ad Group | ctr | Double | \$1=, =, <, > | 
| Ad Group | searchTopImpressionShare | Double | \$1=, =, <, > | 
| Ad Group | searchImpressionShare | Double | \$1=, =, <, > | 
| Ad Group | searchAbsoluteTopImpressionShare | Double | \$1=, =, <, > | 
| Ad Group | relativeCtr | Double | \$1=, =, <, > | 
| Ad Group | conversionAction | String | \$1=, = | 
| Ad Group | conversionActionCategory | String | \$1=, = | 
| Ad Group | conversionActionName | String | \$1=, =, LIKE | 
| Ad Group | updateMask | String |  | 
| Ad Group | create | Struct |  | 
| Ad Group | update | Struct |  | 
| Ad Group | primaryStatus | String | \$1=, = | 
| Ad Group | primaryStatusReasons | List |  | 
| Ad Group Ad | resourceName | String | \$1=, = | 
| Ad Group Ad | id | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group Ad | status | String | \$1=, = | 
| Ad Group Ad | labels | List |  | 
| Ad Group Ad | adGroup | String | \$1=, = | 
| Ad Group Ad | costMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group Ad | approvalStatus | String | \$1=, = | 
| Ad Group Ad | reviewStatus | String | \$1=, = | 
| Ad Group Ad | adStrength | String | \$1=, = | 
| Ad Group Ad | type | String | \$1=, = | 
| Ad Group Ad | businessName | String | \$1=, =, LIKE | 
| Ad Group Ad | date | Date | BETWEEN, =, <, >, <=, >= | 
| Ad Group Ad | allConversionsByConversionDate | Double | \$1=, =, <, > | 
| Ad Group Ad | allConversionsValueByConversionDate | Double | \$1=, =, <, > | 
| Ad Group Ad | conversionsByConversionDate | Double | \$1=, =, <, > | 
| Ad Group Ad | conversionsValueByConversionDate | Double | \$1=, =, <, > | 
| Ad Group Ad | valuePerAllConversionsByConversionDate | Double | \$1=, =, <, > | 
| Ad Group Ad | valuePerConversionsByConversionDate | Double | \$1=, =, <, > | 
| Ad Group Ad | activeViewMeasurableCostMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group Ad | averageCost | Double | \$1=, =, <, > | 
| Ad Group Ad | costPerAllConversions | Double | \$1=, =, <, > | 
| Ad Group Ad | costPerConversion | Double | \$1=, =, <, > | 
| Ad Group Ad | clicks | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group Ad | averagePageViews | Double | \$1=, =, <, > | 
| Ad Group Ad | videoViews | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group Ad | allConversions | Double | \$1=, =, <, > | 
| Ad Group Ad | averageCpc | Double | \$1=, =, <, > | 
| Ad Group Ad | topImpressionPercentage | Double | \$1=, =, <, > | 
| Ad Group Ad | impressions | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Ad Group Ad | absoluteTopImpressionPercentage | Double | \$1=, =, <, > | 
| Ad Group Ad | activeViewCtr | Double | \$1=, =, <, > | 
| Ad Group Ad | ctr | Double | \$1=, =, <, > | 
| Ad Group Ad | conversionAction | String | \$1=, = | 
| Ad Group Ad | conversionActionCategory | String | \$1=, = | 
| Ad Group Ad | conversionActionName | String | \$1=, =, LIKE | 
| Ad Group Ad | updateMask | String |  | 
| Ad Group Ad | create | Struct |  | 
| Ad Group Ad | update | Struct |  | 
| Ad Group Ad | policyValidationParameter | Struct |  | 
| Ad Group Ad | primaryStatus | String | \$1=, = | 
| Ad Group Ad | primaryStatusReasons | List |  | 
| Campaign | resourceName | String | \$1=, = | 
| Campaign | status | String | \$1=, = | 
| Campaign | baseCampaign | String | \$1=, = | 
| Campaign | name | String | \$1=, =, LIKE | 
| Campaign | id | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Campaign | campaignBudget | String | \$1=, =, LIKE | 
| Campaign | startDate | Date | BETWEEN, =, <, >, <=, >= | 
| Campaign | endDate | Date | BETWEEN, =, <, >, <=, >= | 
| Campaign | adServingOptimizationStatus | String | \$1=, = | 
| Campaign | advertisingChannelType | String | \$1=, = | 
| Campaign | advertisingChannelSubType | String | \$1=, = | 
| Campaign | experimentType | String | \$1=, = | 
| Campaign | servingStatus | String | \$1=, = | 
| Campaign | biddingStrategyType | String | \$1=, = | 
| Campaign | domainName | String | \$1=, =, LIKE | 
| Campaign | languageCode | String | \$1=, =, LIKE | 
| Campaign | useSuppliedUrlsOnly | Boolean | \$1=, = | 
| Campaign | positiveGeoTargetType | String | \$1=, = | 
| Campaign | negativeGeoTargetType | String | \$1=, = | 
| Campaign | paymentMode | String | \$1=, = | 
| Campaign | optimizationGoalTypes | List |  | 
| Campaign | date | Date | BETWEEN, =, <, >, <=, >= | 
| Campaign | averageCost | Double |  | 
| Campaign | clicks | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Campaign | costMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Campaign | impressions | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Campaign | useAudienceGrouped | Boolean | \$1=, = | 
| Campaign | activeViewMeasurableCostMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Campaign | costPerAllConversions | Double | \$1=, =, <, > | 
| Campaign | costPerConversion | Double | \$1=, =, <, > | 
| Campaign | invalidClicks | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Campaign | publisherPurchasedClicks | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Campaign | averagePageViews | Double | \$1=, =, <, > | 
| Campaign | videoViews | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Campaign | allConversionsByConversionDate | Double | \$1=, =, <, > | 
| Campaign | allConversionsValueByConversionDate | Double | \$1=, =, <, > | 
| Campaign | conversionsByConversionDate | Double | \$1=, =, <, > | 
| Campaign | conversionsValueByConversionDate | Double | \$1=, =, <, > | 
| Campaign | valuePerAllConversionsByConversionDate | Double | \$1=, =, <, > | 
| Campaign | valuePerConversionsByConversionDate | Double | \$1=, =, <, > | 
| Campaign | allConversions | Double | \$1=, =, <, > | 
| Campaign | absoluteTopImpressionPercentage | Double | \$1=, =, <, > | 
| Campaign | searchAbsoluteTopImpressionShare | Double | \$1=, =, <, > | 
| Campaign | averageCpc | Double | \$1=, =, <, > | 
| Campaign | searchImpressionShare | Double | \$1=, =, <, > | 
| Campaign | searchTopImpressionShare | Double | \$1=, =, <, > | 
| Campaign | activeViewCtr | Double | \$1=, =, <, > | 
| Campaign | ctr | Double | \$1=, =, <, > | 
| Campaign | relativeCtr | Double | \$1=, =, <, > | 
| Campaign | updateMask | String |  | 
| Campaign | create | Struct |  | 
| Campaign | update | Struct |  | 
| Campaign Budget | resourceName | String | \$1=, = | 
| Campaign Budget | id | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Campaign Budget | status | String | \$1=, = | 
| Campaign Budget | deliveryMethod | String | \$1=, = | 
| Campaign Budget | period | String | \$1=, = | 
| Campaign Budget | type | String | \$1=, = | 
| Campaign Budget | name | String | \$1=, =, LIKE | 
| Campaign Budget | amountMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Campaign Budget | explicitlyShared | Boolean | \$1=, = | 
| Campaign Budget | referenceCount | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Campaign Budget | hasRecommendedBudget | Boolean | \$1=, = | 
| Campaign Budget | date | Date | BETWEEN, =, <, >, <=, >= | 
| Campaign Budget | costMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Campaign Budget | startDate | Date | BETWEEN, =, <, >, <=, >= | 
| Campaign Budget | endDate | Date | BETWEEN, =, <, >, <=, >= | 
| Campaign Budget | maximizeConversionValueTargetRoas | Double | \$1=, =, <, > | 
| Campaign Budget | maximizeConversionsTargetCpaMicros | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Campaign Budget | selectiveOptimizationConversionActions | String |  | 
| Campaign Budget | averageCost | Double | \$1=, =, <, > | 
| Campaign Budget | costPerAllConversions | Double | \$1=, =, <, > | 
| Campaign Budget | costPerConversion | Double | \$1=, =, <, > | 
| Campaign Budget | videoViews | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Campaign Budget | clicks | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Campaign Budget | allConversions | Double | \$1=, =, <, > | 
| Campaign Budget | valuePerAllConversions | Double | \$1=, =, <, > | 
| Campaign Budget | averageCpc | Double | \$1=, =, <, > | 
| Campaign Budget | impressions | BigInteger | BETWEEN, =, \$1=, <, >, <=, >= | 
| Campaign Budget | ctr | Double | \$1=, =, <, > | 
| Campaign Budget | updateMask | String |  | 
| Campaign Budget | create | Struct |  | 
| Campaign Budget | update | Struct |  | 

 **Partitioning queries** 

 Additional spark options `PARTITION_FIELD`, `LOWER_BOUND`, `UPPER_BOUND`, `NUM_PARTITIONS` can be provided if you want to utilize concurrency in Spark. With these parameters, the original query would be split into `NUM_PARTITIONS` number of sub-queries that can be executed by spark tasks concurrently. 
+  `PARTITION_FIELD`: the name of the field to be used to partition query. 
+  `LOWER_BOUND`: an inclusive lower bound value of the chosen partition field. 

   For date, we accept the Spark date format used in Spark SQL queries. Example of valid values: `"2024-02-06"`. 
+  `UPPER_BOUND`: an exclusive upper bound value of the chosen partition field. 
+  `NUM_PARTITIONS`: number of partitions. 

 Entity-wise partitioning field support details are captured in the following table. 


| Entity Name | Partitioning Field | Data Type | 
| --- | --- | --- | 
| Ad Group Ad | date | Date | 
| Ad Group | date | Date | 
| Campaign | date | Date | 
| Campaign Budget | date | Date | 

 **Example** 

```
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 Ads connection options
<a name="googleads-connection-options"></a>

The following are connection options for Google Ads:
+  `ENTITY_NAME`(String) - (Required) Used for Read/Write. The name of your Object in Google Ads. 
+  `API_VERSION`(String) - (Required) Used for Read/Write. Google Ads Rest API version you want to use. Example: v16. 
+  `DEVELOPER_TOKEN`(String) - (Required) Used for Read/Write. Required to authenticate the developer or application making requests to the API. 
+  `MANAGER_ID`(String) - Used for Read/Write. A unique identifier that allows you to manage multiple Google Ads accounts. This is the customer ID of the authorized manager. If your access to the customer account is through a manager account, the `MANAGER_ID` is required. For more information, see [login-customer-id](https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid). 
+  `SELECTED_FIELDS`(List<String>) - Default: empty(SELECT \$1). Used for Read. Columns you want to select for the object. 
+  `FILTER_PREDICATE`(String) - Default: empty. Used for Read. It should be in the Spark SQL format. 
+  `QUERY`(String) - Default: empty. Used for Read. Full Spark SQL query. 
+  `PARTITION_FIELD`(String) - Used for Read. Field to be used to partition query. 
+  `LOWER_BOUND`(String)- Used for Read. An inclusive lower bound value of the chosen partition field. 
+  `UPPER_BOUND`(String) - Used for Read. An exclusive upper bound value of the chosen partition field. 
+  `NUM_PARTITIONS`(Integer) - Default: 1. Used for Read. Number of partitions for read. 

# Creating a Google Ads account
<a name="googleads-create-account"></a>

1.  Log in to [Google Ads Developer Account](https://console.cloud.google.com) with your credentials, and go to \$1MyProject.   
![\[The screenshot shows the welcome screen to log in to the Google Ads Developer Account.\]](http://docs.aws.amazon.com/glue/latest/dg/images/google-ads-log-in-developer-account.png)

1.  Choose **New Project** and provide the information which is required for creating Google project if you don't have any registered application in it.   
![\[The screenshot shows the select a project page. Choose New Project in the upper right hand corner.\]](http://docs.aws.amazon.com/glue/latest/dg/images/google-ads-new-project.png)  
![\[The screenshot shows the New Project window to enter a project name and choose a location.\]](http://docs.aws.amazon.com/glue/latest/dg/images/google-ads-new-project-name-location.png)

1.  Choose the **Navigation Tab**, then **API and Setting**, and **Create Client Id** and **ClientSecret** which will require further configuration for creating a connection between AWS Glue and GoogleAds. For more information, see [API credentials](https://console.cloud.google.com/apis/credentials).   
![\[The screenshot shows the APIs and services configuration page.\]](http://docs.aws.amazon.com/glue/latest/dg/images/google-ads-apis-and-services.png)

1.  Choose **CREATE CREDENTIALS** and choose **OAuth client ID**.   
![\[The screenshot shows the APIs and services configuration page with the Create Credentials drop-down and the Oauth client ID option highlighted.\]](http://docs.aws.amazon.com/glue/latest/dg/images/google-ads-create-credentials.png)

1.  Select the **Application type** as **Web application**.   
![\[The screenshot shows the Create OAuth client ID page and the Application type as Web application.\]](http://docs.aws.amazon.com/glue/latest/dg/images/google-ads-oauth-client-id-application-type.png)

1.  Under **Authorised redirect URIs**, add the OAuth Redirect URIs and choose **Create**. You can add multiple redirect URIs if required.   
![\[The screenshot shows the Create OAuth client ID page and the Authorised redirect URIs section. Here, add the URIs and choose ADD URI if needed. Once done, choose CREATE.\]](http://docs.aws.amazon.com/glue/latest/dg/images/google-ads-oauth-redirect-uris.png)

1.  Your **Client Id** and **Client Secret** will be generated when creating a connection between AWS Glue and Google Ads.   
![\[The screenshot shows the Create OAuth client ID page and the Authorised redirect URIs section. Here, add the URIs and choose ADD URI if needed. Once done, choose CREATE.\]](http://docs.aws.amazon.com/glue/latest/dg/images/google-ads-oauth-client-created.png)

1.  Add the scopes according to your application need based, choose **OAuth consent screen** and provide the required information and add the scopes based on requirements.   
![\[The screenshot shows the Update selected scopes page. Select your scopes as needed.\]](http://docs.aws.amazon.com/glue/latest/dg/images/google-ads-selected-scopes.png)

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

The following are limitations for the Google Ads connector:
+ `MANAGER_ID` is an optional input when creating a connection. But when you want to access the customers underlying any particular manager, then `MANAGER_ID` is a mandatory input. The table below explains the access limitations based on whether `MANAGER_ID` is included or not in a connection.    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/glue/latest/dg/googleads-connector-limitations.html)
+ When a manager account is chosen as the object, only `Account` will appear as a sub-object. In the Google Ads connector, entities such as campaigns, ads, etc., are retrieved based on individual client accounts, not the manager account.
+ You cannot retrieve metrics for the manager account. You can retrieve metrics for individual client accounts instead.
+  Each account can have up to 10,000 campaigns, including both active and paused campaigns. For more information, see [Campaign per account](https://support.google.com/google-ads/answer/6372658). 
+  When creating a report, if you choose certain metrics to display, any rows whose selected metrics are all zero won't be returned. For more information, see [ Zero Metrics ](https://developers.google.com/google-ads/api/docs/reporting/zero-metrics?hl=en#exclude_zero_metrics_by_segmenting). 
+  With the following fields, the Full Mapping flow will not work for Account, Ad Group and Ad Group Ad entities, specifically for conversionAction, conversionActionCategory, conversionActionName. For more information, see [ Segment and Metrics ](https://developers.google.com/google-ads/api/docs/reporting/segmentation?hl=en#selectability_between_segments_and_metrics). 
+ A date range filter is mandatory when the `segments.date` field is selected.