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
* Retrieves _all_ active A/B test variants for the given visitor throughout the website.
20
-
* The visitor external id can be retrieved using `IAnalyticsVisitorExternalIdHandler.GetExternalId()`
21
-
22
-
### Example - Getting the A/B test variants for the current visitor
23
-
24
-
This example demonstrates how to create a service that retrieves the active A/B test variants for a specific visitor, content, and culture variation. The service wraps the `IAbTestingVisitorService.GetVisitorAbTestVariants()` method, using the current HttpContext and UmbracoContext to obtain the visitor ID and requested content.
To override this behavior, implement your own `IHttpContextIpAddressExtractor` and instruct Umbraco to use your extractor instead of the default extractor:
It is important that your `UserComposer` adjusts the service registration **after** Umbraco Engage has initialized.
50
+
It is important that your `Composer` adjusts the service registration **after** Umbraco Engage has initialized.
51
51
{% endhint %}
52
52
53
-
This can be enforced using the `ComposeAfterAttribute`. Failing to add this attribute may result in Umbraco running your IUserComposer before the Umbraco Engage composer, causing your changes to be overwritten.
53
+
This can be enforced using the `ComposeAfterAttribute`. Failing to add this attribute may result in Umbraco running your Composer before the Umbraco Engage composer, causing your changes to be overwritten.
54
54
55
-
Additionally, ensure you use `RegisterUnique<...>()` instead of `Register<...>()`. While you can use Register when multiple implementations of a single service exist, in this case, you want your own extractor to be resolved exclusively. Therefore, RegisterUnique will overwrite the Umbraco Engage extractor.
55
+
Additionally, ensure you use `AddUnique<...>()` instead of `AddSingleton<...>()`. While you can use AddSingleton when multiple implementations of a single service exist, in this case, you want your own extractor to be resolved exclusively. Therefore, AddUnique will overwrite the Umbraco Engage extractor.
56
56
57
57
After implementing both classes and running your project, your extractor should be called to resolve IP addresses. You can verify the output of your extractor by inspecting the `umbracoEngageAnalyticsIpAddress` database table. The last portion of the IP address may be anonymized (set to 0) if this option is enabled in the Umbraco Engage configuration file.
This interface allows information about localization for a pageview, defined as a single visitor's visit to a specific point in time. The page view contains the `IpAddress` property that can be used for Geo IP lookup.
22
22
@@ -25,8 +25,10 @@ This interface allows information about localization for a pageview, defined as
if (!IPAddress.TryParse(rawPageview?.IpAddress, outvaripAddress) ||IPAddress.IsLoopback(ipAddress)) returnnull;
49
-
51
+
if (!IPAddress.TryParse(rawPageview?.IpAddress, outvaripAddress) ||IPAddress.IsLoopback(ipAddress))
52
+
returnnull;
53
+
50
54
stringcountry, county, province, city;
51
-
55
+
52
56
//...
53
57
// Perform your own GEO IP lookup here
54
58
// ...
55
-
59
+
56
60
varlocation=newGeoIpLocation
57
61
{
58
62
Country=country,
59
63
County=county,
60
64
Province=province,
61
65
City=city
62
66
};
63
-
67
+
64
68
returnlocation;
65
69
}
66
70
}
@@ -69,23 +73,23 @@ public class MyCustomLocationExtractor : IRawPageviewLocationExtractor
69
73
70
74
4. Let the IoC container know to use your implementation for the `IRawPageviewLocationExtractor`.
71
75
72
-
Umbraco Engage has a default implementation of this service, which only returns null. This default service is registered using Umbraco's `RegisterUnique` method.
76
+
Umbraco Engage has a default implementation of this service, which only returns null. This default service is registered using Umbraco's `AddUnique` method.
73
77
74
-
5. Override this service by calling `RegisterUnique`**after** the `UmbracoEngageApplicationComposer`.
78
+
5. Override this service by calling `AddUnique`**after** the `UmbracoEngageApplicationComposer`.
Copy file name to clipboardExpand all lines: 17/umbraco-engage/developers/headless/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
---
2
2
description: >-
3
-
Discover how to integrate Umbraco.Engage.Headless package with Umbraco 12.0+
3
+
Discover how to integrate `Umbraco.Engage.Headless` package with Umbraco.
4
4
for a Content Delivery API.
5
5
---
6
6
7
7
# Headless
8
8
9
-
Umbraco Engage offers the **Umbraco.Engage.Headless** package for seamless integration with Umbraco 12.0 and later. This package enables access to the Headless Content Delivery API, enabling personalized content, A/B tests, and segmentation.
9
+
Umbraco Engage offers the **Umbraco.Engage.Headless** package for seamless integration with Umbraco. This package enables access to the Headless Content Delivery API, enabling personalized content, A/B tests, and segmentation.
10
10
11
11
{% hint style="info" %}
12
12
All Engage features are supported except:
@@ -28,7 +28,7 @@ All Engage features are supported except:
28
28
29
29
To install Umbraco.Engage.Headless, ensure the following prerequisites:
30
30
31
-
*Umbraco v13 is required to integrate with the [Content Delivery API](https://docs.umbraco.com/umbraco-cms/reference/content-delivery-api).
31
+
*The latest version of Umbraco is required to integrate with the [Content Delivery API](https://docs.umbraco.com/umbraco-cms/reference/content-delivery-api).
32
32
* Enable the [Umbraco Content Delivery API](https://docs.umbraco.com/umbraco-cms/reference/content-delivery-api#enable-the-content-delivery-api) by adding the following configuration setting in the `appsettings.json` file:
Copy file name to clipboardExpand all lines: 17/umbraco-engage/developers/introduction/the-umbraco-engage-cookie/module-permissions.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ description: >-
8
8
9
9
You could choose to give visitors control over these settings through a cookie bar on your site.
10
10
11
-
To do this you have to create an implementation of the `Umbraco.Engage.Business.Permissions.ModulePermissions.IModulePermissions` interface and override our default implementation.
11
+
To do this you have to create an implementation of the `Umbraco.Engage.Infrastructure.Permissions.ModulePermissions.IModulePermissions` interface and override our default implementation.
12
12
13
13
This interface defines 3 methods that you will have to implement:
14
14
@@ -21,7 +21,7 @@ This interface defines 3 methods that you will have to implement:
21
21
/// </summary>
22
22
/// <paramname="context">Context of the request</param>
23
23
/// <returns>True if A/B testing is allowed, otherwise false.</returns>
24
-
boolAbTestingIsAllowed(HttpContextBasecontext);
24
+
boolAbTestingIsAllowed(HttpContextcontext);
25
25
26
26
/// <summary>
27
27
/// Indicates if Analytics is allowed for the given request context.
Using these methods you can control per visitor whether or not the modules are active. Your implementation will need to be registered with Umbraco using the `RegisterUnique()` method, overriding the default implementation which enables all modules all the time. Make sure your composer runs after the Umbraco Engage composer by using the `[ComposeAfter]` attribute.
48
+
Using these methods you can control per visitor whether or not the modules are active. Your implementation will need to be registered with Umbraco using the `AddUnique()` method, overriding the default implementation which enables all modules all the time. Make sure your composer runs after the Umbraco Engage composer by using the `[ComposeAfter]` attribute.
0 commit comments