Query Syntax Helper

Build accurate analytics and campaign queries without errors. Select your query type, add your conditions, and generate a valid query string instantly.

Start Building Your Query
Inline AdSense / Banner

Build Your Query

Generated Query String

// Your query will appear here in real-time...

Example Queries

Click an example to see how it's built.

FAQ & How-To Guide

What is query syntax?

Query syntax refers to the set of rules that define how to correctly structure a request to filter, retrieve, or organize data. Each platform, like Google Analytics or a database, has its own specific syntax. Getting it wrong can lead to errors or incorrect data. This tool helps you build the correct syntax without having to memorize the rules.

What are the main syntax differences?
  • UTM: Uses key-value pairs separated by `&` (e.g., `utm_source=google&utm_medium=cpc`). It does not use complex operators.
  • GA Universal Analytics: Uses a specific format for filters, often with `ga:` prefixes and special operators (e.g., `ga:sourceMedium==google / cpc;ga:sessions>10`). Conditions are separated by semicolons (AND) or commas (OR).
  • Custom Filters: This is a generic builder that lets you define your own syntax rules, useful for internal tools or other platforms.
What are some best practices?

Always use lowercase for keys and values unless the system is case-sensitive. Avoid using spaces; use underscores (`_`) or hyphens (`-`) instead. When building complex filters, start with one condition, test it, and then add more. Always double-check your operators (`==` for exact match, `=~` for regex match, etc.).

Sidebar Ad
(300x250)
Page Contents
Related Tools