Skip to main content

Google Ads Data Source

Follow the instructions below to create a new data flow that ingests data from a Google Ads source in Nexla.
gads_api.png

Google Ads

Create a New Data Flow

  1. To create a new data flow, navigate to the Integrate section, and click the New Data Flow button. Then, select the desired flow type from the list, and click the Create button.

  2. Select the Google Ads connector tile from the list of available connectors. Then, select the credential that will be used to connect to the Google Ads instance, and click Next; or, create a new Google Ads credential for use in this flow.

  3. In Nexla, Google Ads data sources can be created using pre-built endpoint templates, which expedite source setup for common Google Ads endpoints. Each template is designed specifically for the corresponding Google Ads endpoint, making source configuration easy and efficient.
    • To configure this source using a template, follow the instructions in Configure Using a Template.

    Google Ads sources can also be configured manually, allowing you to ingest data from Google Ads endpoints not included in the pre-built templates or apply further customizations to exactly suit your needs.
    • To configure this source manually, follow the instructions in Configure Manually.

Configure Using a Template

Nexla provides pre-built templates that can be used to rapidly configure data sources to ingest data from common Google Ads endpoints. Each template is designed specifically for the corresponding Google Ads endpoint, making data source setup easy and efficient.

Endpoint Settings

  • Select the endpoint from which this source will fetch data from the Endpoint pulldown menu. Available endpoint templates are listed in the expandable boxes below. Click on an endpoint to see more information about it and how to configure your data source for this endpoint.

    Get Discovery Document

    Inspect Google Ads API's discovery document to get a full list of services, information about their URLs, and request and response formats.

    • Enter the Google Ads API version you wish to fetch metadata for in the API Version field. This is the API version for which you want to retrieve the discovery document. The default value is v13 if not specified.

    • The endpoint uses GET requests to https://googleads.googleapis.com/$discovery/rest?version={api_version} where {api_version} is the API Version you provide. The endpoint URL is automatically constructed based on the Google Ads API base URL and the API version.
    • The endpoint does not use pagination and returns the discovery document in a single request.
    • The endpoint will return the complete discovery document for the specified API version, including information about all available services, their URLs, and request and response formats. The response data is extracted from the root-level object in the API response ($), and Nexla will process the entire response structure.

    The discovery document provides comprehensive information about the Google Ads API, including all available services, their endpoints, and the structure of requests and responses. This is useful for understanding the API capabilities and available resources. The endpoint uses a static URL (iteration.type: static.url) and does not require pagination. The response data path is $, which extracts the entire root-level object from the API response. For detailed information about the discovery document, see the Google Ads API documentation.

    Execute Query for Fetching Resource Records

    Execute a GAQL query that fetches records of a specific resource type. This endpoint triggers a GAQL SELECT query on one resource. Try advanced mode for query customizations.

    • Enter the Google Ads customer Account ID that you wish to fetch data for in the Customer Account ID field. This should be the customer ID without hyphens (e.g., 1234567890 instead of 123-456-7890).

    • Enter a comma-separated list of resource attributes to fetch for this object in the Resource Attributes to Fetch field. Attributes should be valid Google Ads API resource attributes (e.g., customer.id,customer.descriptive_name). Use the discovery endpoint to find available field names. The default value is customer.id,customer.descriptive_name if not specified.

    • Enter the resource name to execute the GAQL query on in the Resource Name field. Resource names should be valid Google Ads Resource names (e.g., customer, campaign, ad_group). The default value is customer if not specified.

    • The endpoint uses POST requests to https://googleads.googleapis.com/{api_version}/customers/{customer_id}/googleAds:search with a JSON body containing a GAQL SELECT query. The query is automatically constructed as SELECT {select_cmd} FROM {resource_name} where {api_version} is the API Version from your credential, {customer_id} is the Customer Account ID, {select_cmd} is the Resource Attributes to Fetch, and {resource_name} is the Resource Name you provide.
    • The endpoint uses token-based pagination, automatically fetching additional pages as needed. When a response includes a nextPageToken value, Nexla automatically uses it as the pageToken query parameter for the subsequent request to fetch the next page of results.
    • The endpoint will return all records matching the GAQL query. The response data is extracted from the results array in the API response ($.results[*]), with each record processed individually.

    GAQL (Google Ads Query Language) is a SQL-like query language used to retrieve data from Google Ads resources. Customer Account IDs should be entered without hyphens (e.g., 1234567890 instead of 123-456-7890). Resource attributes should be valid Google Ads API resource attributes, and you can use the discovery endpoint to find available field names. The endpoint uses token-based pagination (iteration.type: paging.next.token) through the nextPageToken mechanism. When a response includes a nextPageToken value, Nexla automatically uses it as the pageToken query parameter for the subsequent request. The response data path is $.results[*], which extracts all items from the results array in the API response. For detailed information about GAQL queries and available resources, see the Google Ads API documentation.

    Execute Query using GAQL

    Execute a GAQL query. Please refer to the API documentation for valid GAQL query syntax.

    • Enter the Google Ads customer Account ID that you wish to execute the query for in the Customer Account ID field. This should be the customer ID without hyphens (e.g., 1234567890 instead of 123-456-7890).

    • Enter the GAQL query to be executed in the Query (GAQL Syntax) field. This should be a valid GAQL query (e.g., SELECT customer.id, customer.descriptive_name FROM customer). The default value is SELECT customer.id, customer.descriptive_name FROM customer if not specified.

    • The endpoint uses POST requests to https://googleads.googleapis.com/{api_version}/customers/{customer_id}/googleAds:search with a JSON body containing the GAQL query. The endpoint URL is automatically constructed based on the Google Ads API base URL, the API version from your credential, and the customer ID.
    • The endpoint uses token-based pagination, automatically fetching additional pages as needed. When a response includes a nextPageToken value, Nexla automatically uses it as the pageToken query parameter for the subsequent request to fetch the next page of results.
    • The endpoint will return all records matching the GAQL query. The response data is extracted from the results array in the API response ($.results[*]), with each record processed individually.

    GAQL (Google Ads Query Language) is a SQL-like query language used to retrieve data from Google Ads resources. Customer Account IDs should be entered without hyphens (e.g., 1234567890 instead of 123-456-7890). GAQL queries follow SQL-like syntax and can include SELECT, FROM, WHERE, ORDER BY, and LIMIT clauses. The endpoint uses token-based pagination (iteration.type: paging.next.token) through the nextPageToken mechanism. When a response includes a nextPageToken value, Nexla automatically uses it as the pageToken query parameter for the subsequent request. The response data path is $.results[*], which extracts all items from the results array in the API response. For detailed information about GAQL query syntax and available resources, see the Google Ads API documentation.

Endpoint Testing

Once the selected endpoint template has been configured, Nexla can retrieve a sample of the data that will be fetched according to the current settings. This allows users to verify that the source is configured correctly before saving.

  • To test the current endpoint configuration, click the Test button to the right of the endpoint selection menu. Sample data will be fetched & displayed in the Endpoint Test Result panel on the right.

  • If the sample data is not as expected, review the selected endpoint and associated settings, and make any necessary adjustments. Then, click the Test button again, and check the sample data to ensure that the correct information is displayed.

Configure Manually

Google Ads data sources can be manually configured to ingest data from any valid Google Ads API endpoint. Manual configuration provides maximum flexibility for accessing endpoints not covered by pre-built templates or when you need custom API configurations.

With manual configuration, you can also create more complex Google Ads sources, such as sources that use chained API calls to fetch data from multiple endpoints or sources that require custom authentication headers or request parameters.

API Method

  1. To manually configure this source, select the Advanced tab at the top of the configuration screen.

  2. Select the API method that will be used for calls to the Google Ads API from the Method pulldown menu. The most common methods are:

    • GET: For retrieving data from the API
    • POST: For sending data to the API or triggering actions
    • PUT: For updating existing data
    • PATCH: For partial updates to existing data
    • DELETE: For removing data

API Endpoint URL

  1. Enter the URL of the Google Ads API endpoint from which this source will fetch data in the Set API URL field. This should be the complete URL including the protocol (https://) and any required path parameters. Google Ads API endpoints typically follow the pattern https://googleads.googleapis.com/{api_version}/{endpoint_path} where {api_version} is the API Version from your credential configuration.

Ensure the API endpoint URL is correct and accessible with your current credentials. You can test the endpoint using the Test button after configuring the URL. The endpoint requires OAuth 2.0 authentication via the Authorization: Bearer {token} header, which is handled automatically by your credential configuration. The endpoint also requires a developer-token header and a login-customer-id header, which are handled automatically by your credential configuration. For detailed information about Google Ads API endpoints and available APIs, see the Google Ads API documentation.