Skip to content

Commit

Permalink
Release V2.0.0 (#16)
Browse files Browse the repository at this point in the history
* remove .net framework

* add .net8

* Added support for multiple ODP instances

* Refactoring; adding logging

* Refactoting and logging
  • Loading branch information
andrewmarkham authored May 3, 2024
1 parent 0f506e9 commit 754f928
Show file tree
Hide file tree
Showing 326 changed files with 1,448 additions and 25,936 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-visitor-groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
workflow_dispatch:

env:
BUILD_NO: 1.4.0.${{ github.run_number }}
BUILD_NO_PRE: 1.4.0-rc.${{ github.run_number }}
BUILD_NO: 2.0.0.${{ github.run_number }}
BUILD_NO_PRE: 2.0.0-rc.${{ github.run_number }}

jobs:
build:
Expand All @@ -25,7 +25,7 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Build (Production)
if: github.ref == 'refs/heads/main'
run: dotnet build --configuration Release -p:Version=${{ env.BUILD_NO }}
Expand Down
7 changes: 7 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": []
}
54 changes: 25 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# Visitor Groups for Optimizely Data Platform

Vistor groups for the Optimizely Data platform, supports Optimizely CMS 11 and 12.

> If you are looking for documentation relevant to V1.* then please refer to the [legacy documentation](./docs/README-legacy.md). This version supports Optimizely CMS 11 and 12.
[![ODP Visitor Groups](https://github.com/made-to-engage/ODP.VisitorGroups/actions/workflows/build-visitor-groups.yml/badge.svg?branch=main)](https://github.com/made-to-engage/ODP.VisitorGroups/actions/workflows/build-visitor-groups.yml)


## Features

Supports multiple ODP instances.

Visitor Groups for:
- Real Time Segments
- Engagement Rank
Expand All @@ -27,11 +30,9 @@ Install the package directly from the Optimizely Nuget repository.
```
dotnet add package UNRVLD.ODP.VisitorGroups
```
```
Install-Package UNRVLD.ODP.VisitorGroups
```

## Configuration (.NET 5.0/6.0)

## Configuration

*Startup.cs*
``` c#
Expand All @@ -45,32 +46,26 @@ All settings are optional, apart from the PrivateApiKey
{
"EPiServer": {
//Other config
"OdpVisitorGroupOptions": {
"OdpCookieName": "vuid",
"CacheTimeoutSeconds": 10,
"BaseEndPoint": "https://api.zaius.com",
"PrivateApiKey": "key-lives-here"
}
"OdpVisitorGroupOptions": {
"OdpCookieName": "vuid",
"CacheTimeoutSeconds": 10,
"SchemaCacheTimeoutSeconds": 86400,
"PopulationEstimateCacheTimeoutSeconds": 4320,
"OdpEndpoints": [
{
"Name": "US", //Unique name for the instance
"BaseEndPoint": "https://api.zaius.com",
"PrivateApiKey": "..."
},
{
"Name": "EU",
"BaseEndPoint": "https://api.zaius.eu",
"PrivateApiKey": "..."
}]
}
}
}
```

## Configuration (.Net Framework)


*web.config*
All settings are optional, apart from the PrivateApiKey
``` xml
<appSettings>
<add key="episerver:setoption:UNRVLD.ODP.OdpVisitorGroupOptions.OdpCookieName, UNRVLD.ODP.VisitorGroups" value="vuid" />
<add key="episerver:setoption:UNRVLD.ODP.OdpVisitorGroupOptions.CacheTimeoutSeconds, UNRVLD.ODP.VisitorGroups" value="1" />
<add key="episerver:setoption:UNRVLD.ODP.OdpVisitorGroupOptions.BaseEndPoint, UNRVLD.ODP.VisitorGroups" value="https://api.zaius.com" />
<add key="episerver:setoption:UNRVLD.ODP.OdpVisitorGroupOptions.PrivateApiKey, UNRVLD.ODP.VisitorGroups" value="key-lives-here" />
</appSettings>
```

You can also manage these with the [options admin module](https://world.optimizely.com/blogs/grzegorz-wiechec/dates/2020/3/configuring-options-from-admin-mode/)

---
## Version History

Expand All @@ -82,4 +77,5 @@ You can also manage these with the [options admin module](https://world.optimize
|1.1.2|Ensure Visitor Group UI doesn’t break if invalid or missing API key|
|1.2.0|Adds counts to the segments, indicating the number of matching profiles|
|1.3.0|Load the RTS segment count async|
|1.4.0|Removed support for .net5<br/>Moved minimum .net framework requirements to v4.7.1<br/>Added support for .net7<br/>Updated minimum version of RestSharp as this caused issues when later versions of optimizely and visitor groups.|
|1.4.0|Removed support for .NET5<br/>Moved minimum .net framework requirements to v4.7.1<br/>Added support for .NET7<br/>Updated minimum version of RestSharp as this caused issues when later versions of optimizely and visitor groups.|
|2.0.0|Added support for .NET8<br/>Added support for multiple ODP instances |
2 changes: 0 additions & 2 deletions VisitorGroups.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
README.md = README.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DemoSite461", "src\DemoSite461\DemoSite461.csproj", "{AFB17DE9-C385-4CAA-A4C5-CB051AD27C72}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{51612577-1690-4EC4-9B9A-F7EC2ABB511E}"
ProjectSection(SolutionItems) = preProject
.github\workflows\build-visitor-groups.yml = .github\workflows\build-visitor-groups.yml
Expand Down
87 changes: 87 additions & 0 deletions docs/README-legacy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Visitor Groups for Optimizely Data Platform

> This document is for V1.* of the module.
Vistor groups for the Optimizely Data platform, supports Optimizely CMS 11 and 12.

[![ODP Visitor Groups](https://github.com/made-to-engage/ODP.VisitorGroups/actions/workflows/build-visitor-groups.yml/badge.svg?branch=main)](https://github.com/made-to-engage/ODP.VisitorGroups/actions/workflows/build-visitor-groups.yml)


## Features

Visitor Groups for:
- Real Time Segments
- Engagement Rank
- Order Likelihood
- Winback zone
- Customer Properties (Text/Numeric)
- Observation
- Total Revenue
- Order Count
- Average Order Revenue

----

## Installation

Install the package directly from the Optimizely Nuget repository.

```
dotnet add package UNRVLD.ODP.VisitorGroups
```
```
Install-Package UNRVLD.ODP.VisitorGroups
```

## Configuration (.NET 5.0/6.0)

*Startup.cs*
``` c#
// Adds the registration for visitor groups
services.AddODPVisitorGroups();
```

*appsettings.json*
All settings are optional, apart from the PrivateApiKey
``` json
{
"EPiServer": {
//Other config
"OdpVisitorGroupOptions": {
"OdpCookieName": "vuid",
"CacheTimeoutSeconds": 10,
"BaseEndPoint": "https://api.zaius.com",
"PrivateApiKey": "key-lives-here"
}
}
}
```

## Configuration (.Net Framework)


*web.config*
All settings are optional, apart from the PrivateApiKey
``` xml
<appSettings>
<add key="episerver:setoption:UNRVLD.ODP.OdpVisitorGroupOptions.OdpCookieName, UNRVLD.ODP.VisitorGroups" value="vuid" />
<add key="episerver:setoption:UNRVLD.ODP.OdpVisitorGroupOptions.CacheTimeoutSeconds, UNRVLD.ODP.VisitorGroups" value="1" />
<add key="episerver:setoption:UNRVLD.ODP.OdpVisitorGroupOptions.BaseEndPoint, UNRVLD.ODP.VisitorGroups" value="https://api.zaius.com" />
<add key="episerver:setoption:UNRVLD.ODP.OdpVisitorGroupOptions.PrivateApiKey, UNRVLD.ODP.VisitorGroups" value="key-lives-here" />
</appSettings>
```

You can also manage these with the [options admin module](https://world.optimizely.com/blogs/grzegorz-wiechec/dates/2020/3/configuring-options-from-admin-mode/)

---
## Version History

|Version| Details|
|:---|:---------------|
|1.0|Initial Release|
|1.1|Add new criterion (Customer Properties)<br/>Support for .net6|
|1.1.1|Refactor code to deal with HttpContect access issue|
|1.1.2|Ensure Visitor Group UI doesn’t break if invalid or missing API key|
|1.2.0|Adds counts to the segments, indicating the number of matching profiles|
|1.3.0|Load the RTS segment count async|
|1.4.0|Removed support for .net5<br/>Moved minimum .net framework requirements to v4.7.1<br/>Added support for .net7<br/>Updated minimum version of RestSharp as this caused issues when later versions of optimizely and visitor groups.|
8 changes: 7 additions & 1 deletion src/DemoSite/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;

namespace DemoSite
Expand All @@ -10,6 +11,11 @@ public class Program
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureCmsDefaults()
.ConfigureWebHostDefaults(webBuilder => webBuilder.UseStartup<Startup>());

.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
}).ConfigureAppConfiguration((ctx,config) => config.AddUserSecrets("2a3dc6de-40c9-422e-8226-46cc8caa54a9"))
;
}
}
36 changes: 29 additions & 7 deletions src/DemoSite/Views/Shared/Layouts/_Root.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
<!DOCTYPE html>
<html lang="@(Model.CurrentPage.Language)">
<head>
<script type='text/javascript'>
var zaius = window['zaius']||(window['zaius']=[]);zaius.methods=["initialize","onload","customer","entity","event","subscribe","unsubscribe","consent","identify","anonymize","dispatch"];zaius.factory=function(e){return function(){var t=Array.prototype.slice.call(arguments);t.unshift(e);zaius.push(t);return zaius}};(function(){for(var i=0;i<zaius.methods.length;i++){var method=zaius.methods[i];zaius[method]=zaius.factory(method)}var e=document.createElement("script");e.type="text/javascript";e.async=true;e.src=("https:"===document.location.protocol?"https://":"http://")+"d1igp3oop3iho5.cloudfront.net/v2/W4WzcEs-ABgXorzY7h1LCQ/zaius-min.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)})();
// Edits to this script should only be made below this line.
zaius.event('pageview');
</script>

<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=10"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
Expand All @@ -34,6 +27,35 @@
</head>

<body>
<script type='text/javascript'>
var zaius = window['zaius']||(window['zaius']=[]);
zaius.methods=["initialize","onload","customer","entity","event","subscribe","unsubscribe","consent","identify","anonymize","dispatch"];
zaius.factory=function(e)
{
return function()
{
var t=Array.prototype.slice.call(arguments);
t.unshift(e);
zaius.push(t);
return zaius
}
};(function()
{
for(var i=0;i<zaius.methods.length;i++)
{
var method=zaius.methods[i];
zaius[method]=zaius.factory(method)
}
var e=document.createElement("script");
e.type="text/javascript";
e.async=true;
e.src=("https://d1igp3oop3iho5.cloudfront.net/v2/PFyPfP2cfC1frOWdg01meQ-eu1/zaius-min.js");
var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)})();
// Edits to this script should only be made below this line.
zaius.event('pageview');
</script>

@if (Model.Layout.IsInReadonlyMode)
{
await Html.RenderPartialAsync("Readonly", Model);
Expand Down
19 changes: 15 additions & 4 deletions src/DemoSite/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,21 @@
}
},
"OdpVisitorGroupOptions": {
"OdpCookieName": "vuid",
"CacheTimeoutSeconds": 1,
"BaseEndPoint": "https://api.zaius.com",
"PrivateApiKey": "key-lives-here"
"OdpCookieName": "vuid",
"CacheTimeoutSeconds": 10,
"SchemaCacheTimeoutSeconds": 86400,
"PopulationEstimateCacheTimeoutSeconds": 4320,
"OdpEndpoints": [
{
"Name": "",
"BaseEndPoint": "https://api.zaius.eu",
"PrivateApiKey": ""
},
{
"Name": "",
"BaseEndPoint": "https://api.zaius.eu",
"PrivateApiKey": ""
}]
}
}
}
Binary file not shown.
Binary file removed src/DemoSite461/App_Data/EPiServerDB_13705f33.mdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
81 changes: 0 additions & 81 deletions src/DemoSite461/Business/AdministratorRegistrationPage.cs

This file was deleted.

Loading

0 comments on commit 754f928

Please sign in to comment.