Set up the Openflow Connector for Google Ads¶

Note

The connector is subject to the Connector Terms.

This topic describes the steps to set up the Openflow Connector for Google Ads.

Prerequisites¶

  1. Ensure that you have reviewed Openflow Connector for Google Ads.

  2. Ensure that you have set up Openflow.

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.

  • Ensure that the Google Ads API is enabled for your Google Cloud project. Google Ads API access is required to ingest data.

  • Configure Service account authentication for Google Ads.

  • Obtain developer token for your organization following instructions.

Note

Developer token should have Access Level either Basic or Standard. For more information about Access Level please see documentation.

Set up Snowflake account¶

As a Snowflake account administrator, perform the following tasks:

  1. Create a new role or use an existing role and grant the Database privileges.

  2. Create a new Snowflake service user with the type as SERVICE.

  3. Grant the Snowflake service user the role you created in the previous steps.

  4. Configure with key-pair auth for the Snowflake SERVICE user from step 2.

  5. Snowflake strongly recommends this step. Configure a secrets manager supported by Openflow, for example, AWS, Azure, and Hashicorp, and store the public and private keys in the secret store.

    Note

    If for any reason, you do not wish to use a secrets manager, then you are responsible for safeguarding the public key and private key files used for key-pair authentication according to the security policies of your organization.

    1. Once the secrets manager is configured, determine how you will authenticate to it. On AWS, it’s recommended that you the EC2 instance role associated with Openflow as this way no other secrets have to be persisted.

    2. In Openflow, configure a Parameter Provider associated with this Secrets Manager, from the hamburger menu in the upper right. Navigate to Controller Settings » Parameter Provider and then fetch your parameter values.

    3. At this point all credentials can be referenced with the associated parameter paths and no sensitive values need to be persisted within Openflow.

  6. If any other Snowflake users require access to the raw ingested documents and tables ingested by the connector (for example, for custom processing in Snowflake), then grant those users the role created in step 1.

  7. Designate a warehouse for the connector to use. Start with the smallest warehouse size, then experiment with size depending on the number of tables being replicated, and the amount of data transferred. Large table numbers typically scale better with multi-cluster warehouses, rather than larger warehouse sizes.

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 role created in the first step. Substitute the role placeholder with the actual value and use the following sql commands:

CREATE DATABASE GOOGLE_ADS_DESTINATION_DB;
CREATE SCHEMA GOOGLE_ADS_DESTINATION_DB.GOOGLE_ADS_DESTINATION_SCHEMA;
GRANT USAGE ON DATABASE GOOGLE_ADS_DESTINATION_DB TO ROLE <GOOGLE_ADS_CONNECTOR_ROLE>;
GRANT USAGE ON SCHEMA GOOGLE_ADS_DESTINATION_DB.GOOGLE_ADS_DESTINATION_SCHEMA TO ROLE <GOOGLE_ADS_CONNECTOR_ROLE>;
GRANT CREATE TABLE ON SCHEMA GOOGLE_ADS_DESTINATION_DB.GOOGLE_ADS_DESTINATION_SCHEMA TO ROLE <GOOGLE_ADS_CONNECTOR_ROLE>;
Copy
  1. Navigate to the Openflow Overview page. In the Featured connectors section, select View more connectors.

  2. On the Openflow connectors page, find the connector and select Add to runtime.

  3. In the Select runtime dialog, select your runtime from the Available runtimes drop-down list.

  4. Select Add.

    Note

    Before you install the connector, ensure that you have created a database and schema in Snowflake for the connector to store ingested data.

  5. 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.

  6. Authenticate to the runtime with your Snowflake account credentials.

The Openflow canvas appears with the connector process group added to it.

Configure the connector¶

  1. Right-click on the imported process group and select Parameters.

  2. 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.

Run the flow¶

  1. Right-click on the plane and select Enable all Controller Services.

  2. 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:

  1. Ensure that there are no more flow files in the queues.

  2. Stop all the processors.

  3. Clear the state of the initial processor.

    1. Right click on the processor Get Google Ads Report and select View State.

    2. Select the option Clear State. This resets the state of the processor.

  4. Drop the destination table in Snowflake.