This blog series  follows the journey of building the recently released Interactive Google Ads Query Builder  tool. Part 1  of this series outlined what we’ll be covering in the series as well as the rationale behind publishing this content. Part 2 will focus on designing a detailed JSON resource schema that will serve as the canonical data set for the Interactive Query Builder Angular  application.Background As mentioned in Part 1 , one of the major benefits of the new Interactive Query Builder is that it provides real-time feedback detailing why fields may or may not be selectable in a given clause of a Google Ads Query Language (GAQL) query. ad_groupsegments.conversion_actionmetrics.absolute_top_impression_percentagead_groupsegments.conversion_actionmetrics.absolute_top_impression_percentagemetrics.absolute_top_impression_percentagesegments.conversion_actionSchema Design (definition at the end of the blog post) A GAQL string requires a single resource in the FROM clause. Given that constraint, the top level JSON schema will be a map from resources to detailed schemas for each resource. For example, the ad_group entry in our schema will look like this:
{
attributed resource  fields.  
 fields entry. The keys of this object will be all of the attributes, metrics, and segments of the top level resource (e.g. ad_group). The value of each item in this object will be objects containing detailed information about that given field, as well as an additional field called incompatible_fields, an array of the fields that are incompatible with the given field. For example, the metrics.phone_impressions entry of the fields object would look like this:
 
Schema Definition For reference, the full schema definition is below:
interface ResourceSchema {attributed resource  fields) 
Conclusion With that, we now have designed an expanded resource schema containing detailed field information and a list of incompatible fields for each field, which we can use in our Angular application. In part 3, we’ll discuss how to create this schema using the GoogleAdsFieldServiceforum  or at googleadsapi-support@google.com.