Sub topic 6
Importing variables: segments, dimensions and metrics
A Free-form exploration starts empty. The Variables panel decides which fields you can use, and Tab Settings decides which of those fields appear in the table. This chapter covers the first step: bringing segments, dimensions and metrics into the Variables panel.
This chapter assumes you have read the earlier chapters on the event-based data model, on dimensions versus metrics, and on scopes. It also assumes you can open a Free-form exploration in a GA4 property where you have at least Viewer access.
What the Variables panel is
The Variables panel is the left-hand column of an exploration. It is a catalog of the fields available to that exploration. It holds:
- The exploration name.
- The date range.
- Segments.
- Dimensions.
- Metrics.
Variables belong to the whole exploration, not to one tab. If you import Device category while working in tab 1, it is also available in tab 2. How you use each variable is a per-tab decision made in Tab Settings.
GA4 has hundreds of dimensions and metrics, and the panel would be unusable if it listed them all. Each new exploration therefore starts with a short default selection, and you add the fields you need.
Importing a variable
Segments, dimensions and metrics all use the same import flow.
- In the Variables panel, select the plus icon (+) next to the section header: Segments, Dimensions or Metrics.
- A dialog opens with the available fields grouped by category.
- Use the search box or open a category to find a field.
- Select the checkbox next to each field you want. You can pick several from different categories in one pass.
- Select Import.
The imported fields now appear in the panel. Nothing has changed in the table yet. Importing makes a field available. It does not use it.
How the dimension catalog is organized
The dimension dialog groups fields by category, for example:
| Category | Typical fields |
|---|---|
| Traffic source | `Session default channel group`, `Session source / medium`, `First user default channel group` |
| Page / screen | `Page path + query string`, `Landing page`, `Page title` |
| Platform / device | `Device category`, `Operating system`, `Browser` |
| Geography | `Country`, `City` |
| Time | `Date`, `Week`, `Hour` |
| Event | `Event name` |
| Custom | Custom dimensions registered for the property |
The category tells you what a field describes. The field's name also tells you its scope. Session default channel group is session-scoped, First user default channel group is user-scoped, and Event name is event-scoped. Two similar-looking channel fields can give different answers, so read the full name before importing.
Metrics worth knowing first
The metrics dialog works the same way. These are the ones you will import most often:
| Metric | What it counts |
|---|---|
| `Sessions` | Visits, each starting with a `session_start` event |
| `Engaged sessions` | Sessions that lasted over 10 seconds, had a key event, or had two or more page or screen views |
| `Total users` | Distinct users who triggered any event |
| `Active users` | Distinct users who had an engaged session or a `first_visit` or `first_open` event |
| `Event count` | Total events |
| `Key events` | Events you have marked as key events |
| `Engagement rate` | `Engaged sessions` divided by `Sessions` |
Custom metrics and calculated metrics defined in the property appear under a custom category. If a custom field is missing, check that someone has registered it in the property's Admin settings. Event parameters that are not registered as custom dimensions or metrics cannot be used in Explore.
Incompatible fields
Not every dimension works with every metric. GA4 only reports a combination when the fields share a compatible scope. Examples include a session-scoped dimension with a session metric, and an event-scoped dimension with Event count. Explore handles this by graying out fields that conflict with what you have already placed in the tab. The same field may be available in one tab and grayed out in another, depending on what each tab already uses.
If a field is grayed out, hover over it. The tooltip explains the incompatibility. A grayed-out field usually means a scope mismatch, not a bug. For example, an item-scoped dimension such as Item name cannot be combined with session-scoped metrics.
Segments in the Variables panel
Segments appear in the same panel, but they behave differently from dimensions and metrics. A dimension or metric is a column of data. A segment is a rule that picks a subset of users, sessions or events. After you import a segment, you can apply it in Tab Settings, either to filter the whole table or to compare several segments side by side.
The Segments import dialog has three kinds of source:
- Suggested segments, such as
PurchasersorMobile traffic, which are prebuilt. - Segments you or colleagues created and shared in the property.
- A new segment, which you create from the same dialog.
A new segment has one of three scopes:
- User segment: includes all of a user's events if the user matches the conditions.
- Session segment: includes only the sessions that match.
- Event segment: includes only the matching events.
Pick the scope that matches the question. "Users who ever purchased" is a user segment. "Sessions that began on mobile" is a session segment. Using the wrong scope is a common cause of surprising numbers. A user segment on Purchasers still includes that user's earlier non-purchase sessions.
The import workflow end to end
The diagram shows where importing sits in the larger flow.
A worked example
Suppose you want to see which acquisition channels bring engaged mobile and desktop sessions. Prepare the Variables panel as follows:
- Import dimensions:
Session default channel group(Traffic source) andDevice category(Platform / device). - Import metrics:
Sessions,Engaged sessionsandTotal users. - Import the suggested segment
Mobile traffic, so you can compare it against all traffic later.
The panel now lists five fields and one segment. Tab Settings is still empty. The next chapters cover placing these fields into rows, columns and values. Because every field here is session-scoped or a user count, none should be grayed out. Now add Item name to the selection. It is item-scoped, and the session metrics you have already used will conflict with it.
Common mistakes
- Expecting the table to change after importing. Importing only adds fields to the panel. You must place them in Tab Settings.
- Importing the wrong scope.
First user default channel groupandSession default channel grouplook alike. The first describes how the user was originally acquired, and the second describes how each session arrived. - Looking for an unregistered parameter. If a custom event parameter is not registered as a custom dimension, it will not show up in the catalog.
- Choosing the wrong segment scope. A user segment and a session segment with the same condition can return different numbers.
- Misreading grayed-out fields. A grayed-out field means it conflicts with something already used in the tab. It does not mean the field is broken or missing.
Exercises
Exercise
You import the dimension Landing page and the metric Event count, but nothing changes in the table. Why, and what must you do next?
Show answer
Importing only adds fields to the Variables panel and does not use them. You must place Landing page and Event count in Tab Settings, for example as a row and a value, before the table updates.
Exercise
You want to analyze sessions that began on mobile, but a colleague built a user segment with the condition "Device category = mobile". Why might its numbers be higher than expected for your question, and what should you create instead?
Show answer
A user segment includes all events and sessions of any user who matched the condition at any time, including sessions on other devices. Create a session segment with the same condition so that only the matching sessions are included.