Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(data-warehouse): add google ads search term conversion action stats (#124552)

Javier Bahamondes4f1af957e628
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/google_ads/canonical_descriptions.py b/products/warehouse_sources/backend/temporal/data_imports/sources/google_ads/canonical_descriptions.py
index 74db685457fe..fb4d139fe0d6 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/google_ads/canonical_descriptions.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/google_ads/canonical_descriptions.py
@@ -717,4 +717,20 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {
}
),
},
+ "search_term_conversion_action_stats": {
+ "description": "Daily search term conversions broken out by conversion action. Only conversion metrics are available alongside this segmentation, so clicks, impressions and cost are in search_term_stats.",
+ "docs_url": "https://developers.google.com/google-ads/api/fields/v25/search_term_view",
+ "columns": {
+ **_IDS,
+ "search_term_view_search_term": "The search query a user entered that triggered an ad.",
+ "segments_conversion_action": "Resource name of the conversion action the conversions are attributed to. Join to conversion_action.",
+ "segments_conversion_action_name": "Name of the conversion action.",
+ "segments_conversion_action_category": "Category of the conversion action (e.g. purchase, lead, sign-up).",
+ "segments_date": _SEGMENTS["segments_date"],
+ "metrics_conversions": _METRICS["metrics_conversions"],
+ "metrics_conversions_value": _METRICS["metrics_conversions_value"],
+ "metrics_all_conversions": _METRICS["metrics_all_conversions"],
+ "metrics_all_conversions_value": _METRICS["metrics_all_conversions_value"],
+ },
+ },
}
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/google_ads/schemas.py b/products/warehouse_sources/backend/temporal/data_imports/sources/google_ads/schemas.py
index 8f0f09b4a230..3c92e9c38590 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/google_ads/schemas.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/google_ads/schemas.py
@@ -1622,4 +1622,34 @@ RESOURCE_SCHEMAS: dict[str, dict[str, Any]] = {
"segments.year",
],
},
+ "search_term_conversion_action_stats": {
+ "resource_name": "search_term_view",
+ "primary_key": [
+ "search_term_view.search_term",
+ "ad_group.id",
+ "campaign.id",
+ "customer.id",
+ "segments.conversion_action",
+ "segments.date",
+ ],
+ "filter_field_names": [("segments.date", IncrementalFieldType.Date)],
+ "should_sync_default": False,
+ "description": "This table fans out per conversion action at search term level, so it only carries conversion metrics. Clicks, impressions and cost are in search_term_stats.",
+ # Most search terms never convert, and those rows carry no information in this table.
+ "extra_where": "metrics.all_conversions > 0",
+ "field_names": [
+ "search_term_view.search_term",
+ "ad_group.id",
+ "campaign.id",
+ "customer.id",
+ "segments.conversion_action",
+ "segments.conversion_action_name",
+ "segments.conversion_action_category",
+ "segments.date",
+ "metrics.conversions",
+ "metrics.conversions_value",
+ "metrics.all_conversions",
+ "metrics.all_conversions_value",
+ ],
+ },
}