What is a Query in Google Analytics?
Thinking about "queries" in Google Analytics can feel intimidating, making you picture complex code or SQL databases. But a query is simply a question you ask your data. This article will show you what a query is in the context of Google Analytics 4, how you’re already using them without realizing it, and how to build your own to get the specific business answers you need.
Demystifying the "Query": What It Really Means
At its heart, a query is a structured request for specific information from a database. Think of Google Analytics as a massive library and your website data is all the books inside. If you wander in without a plan, you might find something interesting, but it will take a while. A query is like walking up to the librarian and saying, "Please show me all the books on 19th-century marketing that were checked out the most last month." It's a precise request that gets a precise answer.
In Google Analytics, every query is built with two fundamental components: Dimensions and Metrics.
- Dimensions: These are the attributes or characteristics of your data. They are typically words, not numbers. Think of them as the "what," "who," or "where." Examples include Country, Traffic Source, Device Category, or Page Title. Dimensions are how you categorize or group your data.
- Metrics: These are the quantitative measurements - the numbers. They answer "how many" or "how much." Examples include Sessions, Users, Conversions, or Total Revenue. Metrics are what you measure within your dimensional categories.
A query happens when you combine them. The simple question, "How many sessions did we get from Organic Search?" is a query. The answer requires bringing together a dimension (Traffic Source = "Organic Search") and a metric (Sessions).
Every Report is a Query: Where to Find Them in GA4
The good news is that you've been running queries this whole time, even if you didn't know it. Nearly everything you click on within the GA4 interface is running a pre-built or custom query for you in the background.
Standard Reports: Queries Made for You
When you navigate to the standard Acquisition reports (like 'Traffic acquisition'), you're looking at the result of a query Google has already built for you. In this case, GA4 is running a query to show you metrics like Users, Sessions, and Conversions broken down by the dimension Session default channel group.
You can even modify this default query right inside the report. By clicking the plus sign (+) next to the primary dimension, you can add a secondary dimension like Device category. Now you've modified the query to ask a more detailed question: "Show me my sessions and conversions by channel grouping, and then break each channel down by whether the users were on desktop, mobile, or tablet." You just reshaped the query in two clicks.
The "Explore" Tab: Your Custom Query Playground
While standard reports are based on predefined queries, the "Explore" section is where you get to build your own from scratch. This is the true heart of custom querying in GA4, allowing you to ask an infinite number of questions about your data.
Building a query here is a visual, drag-and-drop process. Let's say you want to answer the question, "Which are my most engaging landing pages for visitors arriving from Google?"
Here’s how you would build that query in Explore:
- Choose a technique: Start with the "Free-form" technique, which is a flexible table format.
- Import Dimensions: In the "Variables" column, you'll import the dimensions you need. For our question, let's add Landing page + query string and Session source / medium.
- Import Metrics: Next, import the metrics you want to measure. Let’s add Sessions, Engaged sessions, and Average engagement time.
- Build the query visually:
That's it. The table that appears on the right is the answer to your query. You’ve successfully built a custom query without writing a single line of code, just by telling Google Analytics which dimensions and metrics you want to see together.
From Theory to Practice: Queries That Answer Key Business Questions
The real power of queries comes from using them to get actionable insights. Here are a few practical examples of business questions and the queries you can build in GA4's Explore tab to answer them.
Query Example 1: "Where is my most valuable traffic coming from?"
It's one thing to know which channels send traffic, it's another to know which ones send traffic that actually converts and makes money.
- Dimensions: Session default channel group, Session source / medium
- Metrics: Sessions, Total users, Conversions, Total revenue
- What it tells you: By building a table with these ingredients, you can find channels that might have lower traffic but generate disproportionately high revenue or conversions. You might learn that 'Paid Search' has a higher conversion rate than 'Organic Social', guiding your budget decisions.
Query Example 2: "Which blog posts are actually driving newsletter sign-ups?"
Understanding content performance is more than just measuring pageviews. You need to know which articles drive meaningful business outcomes.
- Dimension: Page path and screen class
- Metrics: Views, Sessions, and a specific event metric for sign-ups (e.g., your custom event named newsletter_signup)
- What it tells you: First, filter your "Page path" to only include URLs containing "/blog/". Then, putting these dimensions and metrics together shows you a direct line between content pieces and conversions. You can stop guessing which content works and instead see that posts about "advanced marketing tips" convert three times better than posts about "beginner guides."
Query Example 3: "Are my mobile visitors converting as well as my desktop visitors?"
High mobile traffic is great, but not if those users are running into problems and failing to convert.
- Dimension: Device category
- Metric: Session conversion rate (created by going to Metrics > Create a new custom metric > Name it 'Session conversion rate' > Format 'Percent' > Formula is '[your key conversion event] / Sessions'). You can also just place Sessions and your key conversion event in the table and do the math mentally.
- What it means: This simple query can uncover big technical or user experience problems. If you see high mobile traffic but a conversion rate that’s 80% lower than desktop, it's a huge red flag that your mobile checkout flow might be broken or impossibly slow, costing you revenue every day.
For Power Users: Queries Outside the GA Interface
For most users, running queries happens within the GA4 standard reports or the Explore tab. However, there's another, more technical way to query your data: the Google Analytics Data API.
The API is a "back door" into a company's data. It allows developers and other software tools to send structured queries to Google Analytics and get the raw data back without ever opening the GA website. This is how third-party dashboard tools, spreadsheet add-ons, and data visualization platforms like Tableau or Looker Studio pull your Google Analytics data into their own interfaces.
While building API queries requires programming knowledge, it’s helpful to know it exists. Every time you link GA4 to another tool, that tool is using the API to run queries on your behalf behind the scenes.
Final Thoughts
In the end, a "query" is nothing more than asking a specific question. It’s what you were trying to do all along when you opened Google Analytics in the first place. By understanding that every report is made of dimensions (the categories) and metrics (the numbers), you already know everything you need to start asking better, more precise questions of your data.
Instead of clicking through GA4's interface to manually assemble dimensions and metrics, our platform lets you just ask your question in plain English. For example, you can just ask, "Create a line chart showing sessions and revenue from our top 5 traffic sources for the last 90 days," and Graphed instantly builds the report. We translate your natural language into the precise query needed, pull the live data from all your connected sources like Google Analytics, Shopify, and Facebook Ads, and deliver the answer as an interactive dashboard in seconds, saving you from the manual work inside GA.
Related Articles
How to Connect Facebook to Google Data Studio: The Complete Guide for 2026
Connecting Facebook Ads to Google Data Studio (now called Looker Studio) has become essential for digital marketers who want to create comprehensive, visually appealing reports that go beyond the basic analytics provided by Facebook's native Ads Manager. If you're struggling with fragmented reporting across multiple platforms or spending too much time manually exporting data, this guide will show you exactly how to streamline your Facebook advertising analytics.
Appsflyer vs Mixpanel: Complete 2026 Comparison Guide
The difference between AppsFlyer and Mixpanel isn't just about features—it's about understanding two fundamentally different approaches to data that can make or break your growth strategy. One tracks how users find you, the other reveals what they do once they arrive. Most companies need insights from both worlds, but knowing where to start can save you months of implementation headaches and thousands in wasted budget.
DashThis vs AgencyAnalytics: The Ultimate Comparison Guide for Marketing Agencies
When it comes to choosing the right marketing reporting platform, agencies often find themselves torn between two industry leaders: DashThis and AgencyAnalytics. Both platforms promise to streamline reporting, save time, and impress clients with stunning visualizations. But which one truly delivers on these promises?