We're having problems with Google Ads custom query...
# replication-troubleshooting
e
We're having problems with Google Ads custom query. Most of the metrics we selecting from campaign aren't being sent to the schema. Does anyone else is having this problem? I think this is happening because of the new version published 3 days ago here. Details in the thread.
k
Based on the information in the provided knowledge sources, there have been recent changes and migrations in the Google Ads connector, including updates to the API version and schema handling. Issues with custom queries—especially around metrics not appearing in the schema—can occur for several reasons: 1. API Version Upgrades and Schema Changes: The connector has recently upgraded to Google Ads API v20 in version 4.0.0, which may have resulted in some fields being removed or renamed. If your custom query references fields that were deleted or changed, those fields (including metrics) may not appear in the schema or may cause the stream to fail. You should use the [Google Ads Query Builder](https://developers.google.com/google-ads/api/fields/v20/query_validator) to validate your custom queries against the latest API version. After upgrading, it is recommended to refresh the source schema and reset affected streams to ensure uninterrupted syncs. This process is detailed in the migration guide and changelog documentation[^1][^2]. 2. Custom Query Stream Issues: There have been user reports of custom query streams not appearing in the schema, which in some cases were due to configuration issues such as using a customer ID without the necessary permissions. Ensure that the customer ID used has access to the relevant accounts and data[^3]. 3. Recent Connector Changes: The changelog shows frequent updates, including changes to how custom queries are handled and schema loading logic. For example, version 4.1.0-rc.7 includes a fix for the schema loader for
custom_queries
streams, which could impact the visibility of metrics in the schema[^4]. 4. Known Limitations with Manager Accounts: If you are using a manager account, note that metrics fields are not available for manager accounts in custom queries. The connector will skip queries with metrics for manager accounts, as described in a related GitHub issue[^5]. Recommended Actions: - Validate your custom query with the latest Google Ads API Query Builder. - Refresh your source schema and reset affected streams after any connector upgrade. - Double-check that your customer ID has the correct permissions. - Review the connector changelog for any recent fixes related to custom queries and schema handling. If after these steps the issue persists, it may be related to a recent bug or regression introduced in the latest release. In that case, consider opening a GitHub issue with detailed logs and your query for further investigation. [^1]: [Upgrading to 4.0.0 - Google Ads Migration Guide](https://docs.airbyte.com/integrations/sources/google-ads-migrations#upgrading-to-400) [^2]: [Google Ads Source Changelog](https://docs.airbyte.com/integrations/sources/google-ads#changelog) [^3]: [Source Google Ads - Missing custom queries streams on connection schema](https://github.com/airbytehq/airbyte/issues/52680) [^4]: [Google Ads Source Changelog](https://docs.airbyte.com/integrations/sources/google-ads#changelog) [^5]: [source-google-ads] check_connection - TypeError: 'GAQL' object is not subscriptable](https://github.com/airbytehq/airbyte/issues/59182)
e
This is my custom query:
Copy code
SELECT
  customer.id,
  customer.descriptive_name,
  campaign.id,
  campaign.name,
  metrics.clicks,
  metrics.cost_micros,
  metrics.impressions,
  metrics.absolute_top_impression_percentage,
  metrics.active_view_cpm,
  metrics.active_view_ctr,
  metrics.active_view_impressions,
  metrics.active_view_measurability,
  metrics.active_view_measurable_cost_micros,
  metrics.active_view_measurable_impressions,
  metrics.active_view_viewability,
  metrics.all_conversions,
  metrics.all_conversions_by_conversion_date,
  metrics.all_conversions_from_click_to_call,
  metrics.all_conversions_from_directions,
  metrics.all_conversions_from_interactions_rate,
  metrics.all_conversions_from_menu,
  metrics.all_conversions_from_order,
  metrics.all_conversions_from_other_engagement,
  metrics.all_conversions_from_store_visit,
  metrics.all_conversions_from_store_website,
  metrics.all_conversions_value,
  metrics.all_conversions_value_by_conversion_date,
  metrics.all_new_customer_lifetime_value,
  metrics.average_cart_size,
  metrics.average_cost,
  metrics.average_cpc,
  metrics.average_cpe,
  metrics.average_cpm,
  metrics.average_cpv,
  metrics.average_impression_frequency_per_user,
  metrics.average_order_value_micros,
  metrics.average_page_views,
  metrics.average_target_cpa_micros,
  metrics.average_target_roas,
  metrics.average_time_on_site,
  metrics.bounce_rate,
  metrics.content_budget_lost_impression_share,
  metrics.content_impression_share,
  metrics.content_rank_lost_impression_share,
  metrics.conversions,
  metrics.conversions_by_conversion_date,
  metrics.conversions_from_interactions_rate,
  metrics.conversions_value,
  metrics.conversions_value_by_conversion_date,
  metrics.cost_of_goods_sold_micros,
  metrics.cost_per_all_conversions,
  metrics.cost_per_conversion,
  metrics.cost_per_current_model_attributed_conversion,
  metrics.current_model_attributed_conversions,
  metrics.current_model_attributed_conversions_from_interactions_rate,
  metrics.current_model_attributed_conversions_from_interactions_value_per_interaction,
  metrics.current_model_attributed_conversions_value,
  metrics.current_model_attributed_conversions_value_per_cost,
  metrics.engagement_rate,
  metrics.engagements,
  metrics.gmail_forwards,
  metrics.gmail_saves,
  metrics.gmail_secondary_clicks,
  metrics.gross_profit_margin,
  metrics.gross_profit_micros,
  metrics.interaction_event_types,
  metrics.interaction_rate,
  metrics.interactions,
  metrics.invalid_click_rate,
  metrics.invalid_clicks,
  metrics.lead_cost_of_goods_sold_micros,
  metrics.lead_gross_profit_micros,
  metrics.lead_revenue_micros,
  metrics.lead_units_sold,
  metrics.new_customer_lifetime_value,
  metrics.orders,
  metrics.percent_new_visitors,
  metrics.phone_calls,
  metrics.phone_impressions,
  metrics.phone_through_rate,
  metrics.publisher_organic_clicks,
  metrics.publisher_purchased_clicks,
  metrics.publisher_unknown_clicks,
  metrics.relative_ctr,
  metrics.revenue_micros,
  metrics.search_absolute_top_impression_share,
  metrics.search_budget_lost_absolute_top_impression_share,
  metrics.search_budget_lost_impression_share,
  metrics.search_budget_lost_top_impression_share,
  metrics.search_click_share,
  metrics.search_exact_match_impression_share,
  metrics.search_impression_share,
  metrics.search_rank_lost_absolute_top_impression_share,
  metrics.search_rank_lost_impression_share,
  metrics.search_rank_lost_top_impression_share,
  metrics.search_top_impression_share,
  metrics.sk_ad_network_installs,
  metrics.top_impression_percentage,
  metrics.unique_users,
  metrics.units_sold,
  metrics.value_per_all_conversions,
  metrics.value_per_all_conversions_by_conversion_date,
  metrics.value_per_conversion,
  metrics.value_per_conversions_by_conversion_date,
  metrics.value_per_current_model_attributed_conversion,
  metrics.video_quartile_p100_rate,
  metrics.video_quartile_p25_rate,
  metrics.video_quartile_p50_rate,
  metrics.video_quartile_p75_rate,
  metrics.video_view_rate,
  metrics.video_views,
  metrics.view_through_conversions,
  segments.date
FROM
  campaign
Most of these metrics aren't being loaded in the schema. Example: • metrics.orders • metrics. conversion Google Ads changelog shows commit #69084 was made three days ago, which depending of what time it was commit, wouldn't be noticed by us since we run google ads daily in the evening.
a
Hi Eduardo! Curious to hear - did your issue end up going away? We are suddenly facing the same types of errors (keys not being found), and I'm wondering if this was resolved for you