In the Calculated metric builder, you can apply segments within your metric definition. This is helpful if you want to derive new metrics to use in your analysis. Keep in mind, segment definitions can be updated through the Segment builder. If changes are made, the segment will automatically update anywhere it is applied, including if it is part of a calculated metric definition.
Let’s say you want to compare different aspects of a “German Visitors” segments to those of an “International Visitors” segment. You can create metrics that will give you insights such as:
If you don’t have a comparable segment, create an adhoc segment right in the Calculated Metric Builder called “German Visitors”, where “Countries” equals “Germany”. Just drag the Countries dimension into the Definition canvas and select Germany as the value:
You can also do this in the Segment Builder, but we have simplified the workflow by making dimensions available in the Calculated Metric Builder. “Adhoc” means that the segment is not visible in the Segments list in the left rail. You can however, make it public by hovering over the “i” icon next to it and clicking Make public.
If you don’t have a comparable segment, create a segment called “International Visitors” where “Countries” does not equal “Germany.”
Build and save a metric called “German Visitors” by dragging the Germany segment into the Definition canvas and dragging the Unique Visitors metric within it:
Repeat Step 3 with the International Visitors segment and the Unique Visitors metric to create an International Visitors metric.
In Analysis Workspace, drag the Page Dimension into a Freeform Table and drag the 2 new calculated metrics next to each other to the top:
Here is a video overview:
You can take the example above a step further by comparing your segment to a total population. To do so, create two new metrics, “% of Total German Visitors” and “% of Total International Visitors”:
Drop the German (or International) Visitors segment into the canvas.
Drop another German (or International) Visitors segment below. However, this time, click its configuration (gear) icon to select the Metric Type “Total”. The Format should be “Percent”. The operator should be “divided by”. You end up with this metric definition:
Apply this metric to your project: