Google Search Ads Operators

Create, manage, and track high-impact campaigns across multiple search engines with one centralized tool. For more information check Google Search Ads.

Prerequisite Tasks

To use these operators, you must do a few things:

Querying a report

To query a Search Ads report use the GoogleSearchAdsSearchOperator.

tests/system/providers/google/marketing_platform/example_search_ads.py[source]

query_report = GoogleSearchAdsSearchOperator(
    task_id="query_report",
    customer_id=CUSTOMER_ID,
    query=QUERY,
)

You can use Jinja templating with api_version, gcp_conn_id, page_token, page_size parameters which allows you to dynamically determine values.

Retrieve a field metadata

To retrieve metadata of a field use GoogleSearchAdsGetFieldOperator.

tests/system/providers/google/marketing_platform/example_search_ads.py[source]

get_field = GoogleSearchAdsGetFieldOperator(
    task_id="get_field",
    field_name=FIELD_NAME,
)

You can use Jinja templating with api_version, gcp_conn_id parameters which allows you to dynamically determine values.

Retrieve metadata for multiple fields

To retrieve metadata of multiple fields use the GoogleSearchAdsSearchFieldsOperator.

tests/system/providers/google/marketing_platform/example_search_ads.py[source]

search_fields = GoogleSearchAdsSearchFieldsOperator(
    task_id="search_fields",
    query=SEARCH_FIELDS_QUERY,
)

You can use Jinja templating with api_version, gcp_conn_id, page_token, page_size parameters which allows you to dynamically determine values.

Retrieve a custom column details

To retrieve details of a custom column use GoogleSearchAdsGetCustomColumnOperator.

tests/system/providers/google/marketing_platform/example_search_ads.py[source]

get_custom_column = GoogleSearchAdsGetCustomColumnOperator(
    task_id="get_custom_column",
    customer_id=CUSTOMER_ID,
    custom_column_id=CUSTOM_COLUMN_ID,
)

You can use Jinja templating with api_version, gcp_conn_id parameters which allows you to dynamically determine values.

Retrieve a custom column details

To retrieve the list of all custom columns use

GoogleSearchAdsListCustomColumnsOperator.

tests/system/providers/google/marketing_platform/example_search_ads.py[source]

list_custom_columns = GoogleSearchAdsListCustomColumnsOperator(
    task_id="list_custom_columns",
    customer_id=CUSTOMER_ID,
)

You can use Jinja templating with api_version, gcp_conn_id parameters which allows you to dynamically determine values.

Was this entry helpful?