You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 13/umbraco-engage/developers/personalization/implement-your-own-segment-parameters.md
+15-13Lines changed: 15 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,9 @@ In the following guide, we will show how this is done. There are 3 steps:
17
17
18
18
This guide will use code samples to add a "**Day of week**" segment parameter where you can select a single day of the week. If a pageview happens on that day the segment parameter will be satisfied.
19
19
20
-
You can download the following code to add this [parameter directly to your solution](../../../../%7BlocalLink:umb:/media/50f4fa6c22b54c4db9c3ac402e43e226%7D/).
20
+
You can download the following code files to your project to add the parameter directly to your solution.
@@ -26,8 +28,8 @@ In code, we refer to a segment parameter as a **segment rule**.
26
28
27
29
A segment rule is:
28
30
29
-
* A unique rule identifier, e.g. "**DayOfWeek**".
30
-
* A configuration object, e.g. **"{ dayOfWeek: 3 }"**.
31
+
* A unique rule identifier, e.g. `DayOfWeek`.
32
+
* A configuration object, e.g. `{ dayOfWeek: 3 }`.
31
33
* This is optional, but most rules will have some sort of configuration that the user can alter in the Segment Builder. In our example, the user can configure the specific day of the week.
32
34
* A method that specifies whether the rule is satisfied by the current page view.
33
35
@@ -57,7 +59,7 @@ public class DayOfWeekSegmentRuleFactory : ISegmentRuleFactory{ public string
57
59
```
58
60
{% endcode %}
59
61
60
-
We are using the class **DayOfWeekSegmentRuleConfig** as a representation of the configuration of the rule, which is not strictly necessary but makes it easier. The configuration is stored as a string in the database but in code, we like to have IntelliSense so we parse the stored configuration to this class:
62
+
We are using the class `DayOfWeekSegmentRuleConfig` as a representation of the configuration of the rule, which is not strictly necessary but makes it easier. The configuration is stored as a string in the database but in code, we like to have IntelliSense so we parse the stored configuration to this class:
61
63
62
64
{% code overflow="wrap" %}
63
65
```csharp
@@ -85,7 +87,7 @@ This step will show concrete code samples that belong to our demo parameter "**D
85
87
\
86
88
You need to create a folder in the _App\_Plugins_ folder of your project that will hold the new files.
87
89
88
-
For this example name it "**day-of-week**". The folder and content look like this:
90
+
For this example name it "`day-of-week`". The folder and content look like this:
89
91
90
92
***App\_Plugins\day-of-week**
91
93
*`package.manifest`
@@ -117,13 +119,13 @@ In this file, you define the segment parameter and register it in the repository
117
119
118
120
*`segment-rule-day-of-week-editor.html`
119
121
120
-
This file contains the view of your parameter editor. Our example editor is a **\<select>** filled with the 7 days of the week.
122
+
This file contains the view of your parameter editor. Our example editor is a `<select>` filled with the 7 days of the week.
121
123
122
-
We write the picked value to the "**config.dayOfWeek**" property of our rule. You can make the editor as complex as you want, use multiple fields, etc.
124
+
We write the picked value to the `config.dayOfWeek` property of our rule. You can make the editor as complex as you want, use multiple fields, etc.
123
125
124
-
For more inspiration, you can look at the built-in rule editors of Umbraco Engage in **App\_Plugins\Umbraco.Engage\dashboard\segments\builder\rules**.
126
+
For more inspiration, you can look at the built-in rule editors of Umbraco Engage in `App_Plugins\Umbraco.Engage\dashboard\segments\builder\rules`.
125
127
126
-
We use the "**data.days**" property of our rule definition in the editor. The editor gets passed in the rule definition as well as a "**config**" object which we should update according to the user input.
128
+
We use the `data.days` property of our rule definition in the editor. The editor gets passed in the rule definition as well as a `config` object which we should update according to the user input.
@@ -155,14 +157,14 @@ We want to display the picked day to the user:
155
157
```
156
158
{% endcode %}
157
159
158
-
We store the chosen day of the week as an **integer 0-6 ($ctrl.config.dayOfWeek)** but in the display component, we want to show the actual day (e.g. "**Monday**"). Our rule definition defines the mapping in its "**data.days**" property so we convert it using that and display the name of the day.
160
+
We store the chosen day of the week as an integer 0-6 ($ctrl.config.dayOfWeek) but in the display component, we want to show the actual day (e.g. `Monday`). Our rule definition defines the mapping in its `data.days` property so we convert it using that and display the name of the day.
159
161
160
162
*`segment-rule-day-of-week-display.js`
161
163
162
164
In this file, we register the display component.
163
165
164
166
```
165
-
// If you have your own custom module, use that name instead of "umbraco"
167
+
// If you have a custom module, use that name instead of "umbraco"
@@ -195,11 +197,11 @@ The new segment parameter will show up automatically in the [Cockpit](../../../.
195
197
196
198
This includes active segments of the current visitor, and therefore your new segment parameter can also show up in the cockpit. By default, it will display the **raw configuration of the parameter** as stored in the database ("{ dayOfWeek: 3 }" in our example).
197
199
198
-
If you hover over it you will see the rule identifier "**DayOfWeek**" rather than a friendly name.
200
+
If you hover over it you will see the rule identifier `DayOfWeek` rather than a friendly name.
199
201
200
202

201
203
202
-
If you want to change this to be more readable you can implement the **Umbraco.Engage.Web.Cockpit.Segments.ICockpitSegmentRuleFactory** interface.
204
+
If you want to change this to be more readable you can implement the `Umbraco.Engage.Web.Cockpit.Segments.ICockpitSegmentRuleFactory` interface.
203
205
204
206
For the `DayOfWeek` demo parameter, this is the implementation:
When you select a segment, you will see an overview of the configuration. As you scroll down, you can monitor its performance.
19
+
20
+
Learn more about segments and how to set them up in the [Personalization section](personalization/creating-a-segment.md).
21
+
22
+
### Segment Potential
23
+
24
+
The segment potential depends on how many pageviews, sessions, and profiles are covered within the segment.
25
+
26
+
In the Reporting dashboard, you can see the coverage of these parameters. You can also see the number of sessions a new profile requires to activate the selected segment.
27
+
28
+
### Segment Personalization
29
+
30
+
In many cases, it can be interesting to monitor how many of your website's sessions, page views, and profiles have been personalized.
31
+
32
+
In the Segment Personalization section, you can see how much of the incoming traffic on your website is personalized.
33
+
34
+
### Goal Performance
35
+
36
+
You can also get an overview of how the goals you have configured are performing. The table in the Goal Performance section compares the goal performance between the control group and the personalized group.
0 commit comments