The main scope of this workflow is to provide a local data application to test Google Ads Custom Queries with your Google Ads data. Execute the "Custom Report" component and click the lens icon to open the view.
We are passing dynamically custom queries inside the component to the Google Ads Query node to demonstrate the capabilities of KNIME workflow building with the Google Ads Query node.
You can download and run the workflow in your local KNIME Analytics Platform. However, you need the latest version to do so.
It is also possible to deploy the workflow as a data application in KNIME Business Hub using the Secret Store feature and the Secrets Retriever node instead of the Google Authenticator.
Before you run the workflow, you need to authenticate actively. Using Google APIs with OAuth 2.0 "on your behalf" allows third-party applications to access and interact securely with your Google services, such as Google Sheets and Google Ads, enhancing functionality and user experience while maintaining security and control over your data.
Additionally, you will need:
Google Ads Developer Token
Manager Customer Account ID
Account ID
Please refer to the description of the Google Ads Connector to get more information about how to obtain these items.
Workflow Step-by-Step
String Configuration Nodes
Pass the necessary items to connect to the desired Google Ads account (Developer token, Manager Customer ID, Account ID). You need to input your own as the default of the nodes. It is possible to add more than one account by passing them comma-separated (account1, account2, etc.).
Unpack Account IDs
In the "Unpack Account Id" metanode, unpack the account IDs comma-separated into a table.
Custom Report Component
Right-click Component > Open Component to access the "Custom Report" component.
Iterate Over Account IDs
Use a Table Row to Flow Variable Loop to iterate over the Account IDs, fetching the data for each account and then concatenating the results.
Authenticate and Connect
Use the Google Authenticator for interactive authentication, providing the custom scope in the node comments. Then, connect to the Google Ads Account by providing the specified items in the Google Ads Connector node (using previously generated flow variables).
Google Ads Query Node
Use the custom query mode controlled by a flow variable. Use the Google Ads Query Builder (see the link in the External Resources section) to help build your custom query.
Example Query:
"SELECT
segments.conversion_action,
segments.conversion_action_name,
segments.date,
segments.hour,
metrics.all_conversions,
metrics.all_conversions_value
FROM ad_group
WHERE
segments.date DURING LAST_MONTH"
You can copy-paste the above query into the data application.
Collect and Plot Data
Collect data from all iterations (all the Account IDs) and plot them in the table view.
Opening the View
After execution, open the component's view by clicking the lens icon. You can copy-paste custom queries and, by clicking refresh, see the results fetched from your Google Ads account.