Set up the Openflow Connector for Google Ads¶
Note
This connector is subject to the Snowflake Connector Terms.
This topic describes the steps to set up the Openflow Connector for Google Ads.
Prerequisites¶
- Ensure that you have reviewed About Openflow Connector for Google Ads.
- Ensure that you have Set up Openflow - Snowflake Deployments or Set up Openflow - BYOC.
- If using Openflow - Snowflake Deployments, ensure that you’ve reviewed configuring required domains and have granted access to the required domains for the Google Ads connector.
Get the credentials¶
As a Google Ads administrator, perform the following steps:
- Ensure that you have access to a Google Cloud project or create a new one (https://developers.google.com/workspace/guides/create-project).
- Ensure that the Google Ads API (https://cloud.google.com/endpoints/docs/openapi/enable-api) is enabled for your Google Cloud project. Google Ads API access is required to ingest data.
- Configure (https://developers.google.com/google-ads/api/docs/oauth/service-accounts) Service account authentication for Google Ads.
- Obtain developer token for your organization following instructions (https://developers.google.com/google-ads/api/docs/get-started/dev-token).
Note
Developer token should have Access Level either Basic or Standard. For more information about Access Level please see documentation (https://developers.google.com/google-ads/api/docs/access-levels).
Set up Snowflake account¶
As an Openflow administrator, perform the following tasks to set up your Snowflake account. With the
default SNOWFLAKE_MANAGED authentication strategy, the runtime’s execute-as role is the identity
the connector uses to access Snowflake, so you grant it the following privileges.
Note
If you’re deploying the connector in Openflow - BYOC Deployments and using the KEY_PAIR authentication
strategy instead of the recommended SNOWFLAKE_MANAGED, you’ll also grant this same execute-as
role to a service user rather than relying on the runtime’s managed token. See
Set up key-pair authentication for Openflow - BYOC Deployments
to create the service user.
Create database, schema, and warehouse¶
-
Create the destination database:
-
Create the destination schema:
-
Grant the required privileges to the runtime’s execute-as role:
-
Create a warehouse (or use an existing one) and grant usage privileges:
-
If any other Snowflake users require access to the tables ingested by the connector (for example, for custom processing in Snowflake), grant those users the execute-as role.
Set up the connector¶
As a data engineer, perform the following tasks to install and configure the connector:
Install the connector¶
- Create a database and schema in Snowflake for the connector to store ingested data. Grant required Database privileges to the execute-as role, as described in Set up Snowflake account.
To install the connector, do the following as a data engineer:
-
Navigate to the Connector library tab in Openflow.
-
On the Openflow connectors page, find the connector and select Install.
-
In the Select runtime dialog, select your runtime from the Available runtimes drop-down list and click Install.
Note
Before you install the connector, ensure that you have created a database and schema in Snowflake for the connector to store ingested data.
-
Authenticate to the deployment with your Snowflake account credentials and select Allow when prompted to allow the runtime application to access your Snowflake account. The connector installation process takes a few minutes to complete.
-
Authenticate to the runtime with your Snowflake account credentials.
The Openflow canvas appears with the connector process group added to it.
Configure the connector¶
- Right-click on the imported process group and select Parameters.
- Populate the required parameter values as described in Flow parameters.
Flow parameters¶
There are three parameter contexts. Google Ads Destination Parameters and Google Ads Source Parameters are respectively responsible for allowing connections with GoogleAds API and Snowflake. Google Ads Ingestion Parameters is used to define the reconfiguration of data downloaded from Google Ads. Google Ads Parameters aggregates all of them in one.
Google Ads Ingestion Parameters¶
| Parameter | Description | Required |
|---|---|---|
| Client Account ID | ID of the account in the Google Ads for which given report should be ingested | true |
| Login Customer ID | Customer ID of the Google Ads manager account (MCC) for which the report should be ingested | false |
| Google Ads Resource Name | Name of the resource in Google Ads that is a source for the report | true |
| Report Attributes | Attributes of the selected resource | true |
| Report Metrics | Metrics collected in the context of a given resource | false |
| Report Segments | Buckets in which metrics should be grouped | false |
| Report Start Date | Start date from which the ingestion should happen. The date format is YYYY-MM-DD. | false |
| Schedule | Get Google Ads Report processor schedule | true |
Note
The easiest way to obtain proper combination of Report Attributes, Report Metrics and Report Segments is to use Google Ads Query Builder (https://developers.google.com/google-ads/api/fields/v19/overview_query_builder). Select the resource based on the one inserted into parameter Google Ads Resource Name and construct the query. Then copy and paste attributes, metrics and segments to corresponding parameters.
Google Ads Source Parameters¶
| Parameter | Description | Required |
|---|---|---|
| Google Developer Token | Developer token required to query Google Ads API | true |
| Google Service Account JSON | Service Account JSON required for Google Ads authentication | true |
Google Ads Destination Parameters¶
| Parameter | Description | Required |
|---|---|---|
| Destination Database | The database where data will be persisted. It must already exist in Snowflake. The name is case-sensitive. For unquoted identifiers, provide the name in uppercase. | Yes |
| Destination Schema | The schema where data will be persisted, which must already exist in Snowflake. The name is case-sensitive. For unquoted identifiers, provide the name in uppercase. See the following examples:
| Yes |
| Snowflake Authentication Strategy | When using:
| Yes |
| Snowflake Account Identifier | When using:
| Yes |
| Snowflake Private Key | When using:
| No |
| Snowflake Private Key File | When using:
| No |
| Snowflake Private Key Password | When using:
| No |
| Snowflake Role | When using:
| Yes |
| Snowflake Username | When using:
| Yes |
| Snowflake Warehouse | Snowflake warehouse used to run queries. | Yes |
Run the flow¶
- Right-click on the plane and select Enable all Controller Services.
- Right-click on the imported process group and select Start. The connector starts the data ingestion.
How to reset the connector¶
To fully reset connector to the initial state, do the following:
-
Ensure that there are no more flow files in the queues.
-
Stop all the processors.
-
Clear the state of the initial processor.
- Right click on the processor
Get Google Ads Reportand select View State. - Select the option Clear State. This resets the state of the processor.
- Right click on the processor
-
Drop the destination table in Snowflake.