# Transition from AdWords to Google Ads API

**URL:** <https://community.cdata.com/t/transition-from-adwords-to-google-ads-api/766>\
**Category:** CData Virtuality \[Archived\]\
**Tags:** article, cdata-virtuality\
**Created:** [June 10, 2024, 4:22pm UTC](https://community.cdata.com/t/transition-from-adwords-to-google-ads-api/766 "2024-06-10T16:22:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous](https://avatars.discourse-cdn.com/v4/letter/a/8491ac/32.png) [@anonymous](https://community.cdata.com/u/anonymous)\
**Post date:** [June 10, 2024, 4:22pm UTC](https://community.cdata.com/t/transition-from-adwords-to-google-ads-api/766/1 "2024-06-10T16:22:56Z")

</div>

## Configure a Google Ads API data source

### Get the connector

For comfortable usage of the new Google Ads API a modular connector&nbsp;_which is currently not shipped with the Data Virtuality Server_&nbsp;is necessary.

Please reach out to Data Virtuality Support team to get installation instructions and files matching your Data Virtuality Server version.

### Deploy the connector&nbsp;

Check whether the modular connector is present on the Data Virtuality Server:

```auto
SELECT "name", "deployed"FROM "SYSADMIN.ModularConnectors"WHERE "name" = 'google-ads-api'

```

If the result is empty, the connector is not yet installed. In that case, as mentioned above, please reach out to Data Virtuality Support.

If the result is not empty, you can deploy the connector:

```auto
CALL "SYSADMIN.deployModularConnector"("name" => 'google-ads-api', "deploy" => true);;

```

### Configure the data source

After successful deployment, the Google Ads API data source can be created. The credentials are same as used in the AdWords data source:

```auto
CALL "SYSADMIN.createConnection" ( "name" => 'google_ads_datasource' , "jbossCLITemplateName" => 'googleads' , "connectionOrResourceAdapterProperties" => 'ClientId=<ClientId>,UserAgent=<UserAgent>,ClientSecret=<ClientSecret>,DeveloperToken=<DeveloperToken>,RefreshToken=<RefreshToken>');;

```

```auto
CALL "SYSADMIN.createDataSource" ( "name" => 'google_ads_datasource' , "translator" => 'google_ads_api');;

```

### Usage

In Google Ads API each criteria report is represented by a separate resource.&nbsp;A&nbsp; **complete list** &nbsp;of the old AdWords resources and their new corresponding Google Ads API resources can be found on this&nbsp; **resource mappings page:**

```auto
https://developers.google.com/google-ads/api/docs/migration/mapping

```

Please notice the following generic rules for translation of Google Ads API names to Data Virtuality Server column names:

- The character “.” is translated to character “\_”.  
Example: “customer.descriptive\_name” is “customer\_descriptive\_name” in the Google Ads API connector.
- The prefixes “segments.” and “metrics.” are not included into column name  
Example: “metrics.cost\_micros” is “cost\_micros” in the Google Ads API connector.

While all reports are available by querying the Google Ads API data source tables, the new Google Ads API connector also provides a predefined&nbsp; **set of procedures for most popular reports**.

If you cannot use one of the predefined procedures but have to query tables, please be aware of the following rules:

- A where specifying a customer\_id and/or a date range is mandatory for most of the tables.
- The combination of fields selected together need to be valid for being combined on Google Ads side.&nbsp;Hence select star is not recommended and won’t work for most tables.

## Sample of a report transition to Google Ads API

This example is the “Ad performance” report as present on old AdWords connector:

```auto
SELECT "Date" , "CustomerDescriptiveName" , "AdGroupId" , "AdGroupName" , "AdGroupStatus" , "Clicks" , "Ctr" , "Impressions"FROM "old_adwords.getAD_PERFORMANCE_REPORT" (   "customerId" => x   , "startDate" => TIMESTAMPADD (SQL_TSI_DAY, -3, CURDATE ())   , "endDate" => CURDATE ()   , "fields" => 'AdGroupId,AdGroupName,AdGroupStatus,Clicks,Ctr,CustomerDescriptiveName,Date,Impressions');;

```

Same data via new Google Ads API connector:

```auto
SELECT "date" , "customer_descriptive_name" , "ad_group_id" , "ad_group_name" , "ad_group_status" , "clicks" , "ctr" , "impressions"FROM "google_ads_datasource.ad_group_ad"WHERE   "customer_id" = x    AND "date" BETWEEN TIMESTAMPADD (SQL_TSI_DAY, -3, CURDATE ()) AND CURDATE ()ORDER BY "date";;

```
