Sub topic 6
Importing Variables: Segments, Dimensions, and Metrics
A Free-form exploration uses variables to define what you want to analyze. This chapter assumes that you can access a GA4 property, understand basic events, and read a simple table or pivot table.
The Variables panel is the planning area on the left side of the Explore workspace. It contains the segments, dimensions, and metrics available to the exploration. Importing a field makes it available for the current exploration. It does not change the underlying GA4 data.
What belongs in the Variables panel?
A dimension is a descriptive attribute, such as Country, Device category, or Session default channel group. Dimensions usually become rows or columns in the report.
A metric is a measured value, such as Sessions, Engaged sessions, or Total users. Metrics usually become values in the report.
A segment is a rule that defines a subset of users or sessions, such as users who visited a product page or sessions from mobile devices. Segments let you compare one group with another.
| Variable | Answers | Typical use |
|---|---|---|
| Dimension | “Which category or attribute?” | Rows or columns |
| Metric | “How much or how many?” | Values |
| Segment | “Which subset should I compare?” | Comparisons |
Import dimensions and metrics
- Open Explore and create or select a Free-form exploration.
- In the Variables panel, select the plus sign beside Dimensions.
- Search for fields such as
Session default channel group,Device category, andLanding page. - Select the fields and choose Import.
- Repeat the process beside Metrics.
- Import metrics such as
Sessions,Engaged sessions, andTotal users.
Imported fields appear in the Variables panel. They are not automatically shown in the table. Drag a dimension into Rows or Columns in Tab Settings. Drag a metric into Values.
Create and import a segment
Select the plus sign beside Segments to create a segment or choose from suggested segments. Define the conditions, select the scope, and give the segment a clear name.
For example, create a segment called Mobile sessions with the condition Device category exactly matches mobile. After saving it, the segment appears in Variables. Drag it to the Segment comparisons area in Tab Settings.
A segment can be user-based, session-based, or event-based. The scope determines which records qualify. A user segment can include all activity from a qualifying user, while a session segment evaluates individual visits.
Check compatibility before building
GA4 fields have scopes. Event-scoped fields describe individual events, session-scoped fields describe visits, and user-scoped fields describe people or devices over time. GA4 may reject combinations that cannot be meaningfully joined. A report can also produce misleading results when a dimension and metric use different scopes.
Use the field descriptions and the report preview to check your choices before interpreting the results.
Exercise
You want to compare sessions from mobile and desktop devices by marketing channel. Which variables should you import?
Show answer
Import the Session default channel group dimension and the Sessions metric. Create or import mobile and desktop session segments, then add the segments to Segment comparisons.