Code Monkey home page Code Monkey logo

odp.visitorgroups's People

Contributors

andrewmarkham avatar daniel-isaacs avatar davidknipe avatar stefanolsen avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

odp.visitorgroups's Issues

Some Online Data Platform Criteria are not working.

For the example visitor group, Any account with first name ‘Admin’ should be apart if the visitor group. Verifying the information on ODP, the user [email protected] should be apart of the group
6c5bf9de-7214-4ee4-a2e7-de5f2237e59e
7da9bb3f-2013-4d70-862a-c80f40319ce9
However this user doesn't trigger the group when used to personalize content or show on our user-debug page where we list out our visitor groups that a user matches.
519b4610-9fbe-46bf-8ef1-61f2b8437187

Our Configuration:
"OdpVisitorGroupOptions": {
"OdpCookieName": "vuid",
"CacheTimeoutSeconds": 1,
"OdpEndpoints": [
{
"Name": "US", //Unique name for the instance
"BaseEndPoint": "https://api.zaius.com",
"PrivateApiKey": "[Key]"
}
]
},

From startup.cs
public void ConfigureServices(IServiceCollection services)
{
// set the data directory
AppDomain.CurrentDomain.SetData("DataDirectory", Path.Combine(_webHostingEnvironment.ContentRootPath, "App_Data"));

    // configure application cookie
    services.ConfigureApplicationCookie(options =>
    {
        options.Cookie.SameSite = SameSiteMode.None;
        options.Cookie.SecurePolicy = CookieSecurePolicy.Always;
    });

    services.Configure<CookiePolicyOptions>(options =>
    {
        options.MinimumSameSitePolicy = SameSiteMode.None;
    });

    services.Configure<FormOptions>(options =>
    {
        options.ValueCountLimit = int.MaxValue;
    });

    // custom configuration
    services.ConfigureSerilogLogging(_config);
    services.ConfigureAzureServiceBus(_config);
    services.ConfigureApplicationServices(_config);
    services.ConfigureChadwellIdentity(_config);
    services.ConfigurePunchout();
    services.ConfigureAssociations();
    services.ConfigureGetaNotFoundHandler(_config);
    services.ConfigureUploadOptions(_config);

    services.AddCms()
          .Configure<MvcOptions>(m =>
          {
              m.ModelMetadataDetailsProviders.Add(new CustomModelMetadataProvider());//custom model attributes for validation in cms admin
          })
        .AddCommerce() // set up commerce admin, wire up commerce routs  for categories and product pages.
        .AddFind()     // add find admin
        .AddFindSearchProvider() // add default find services
        .AddAdminUserRegistration()
        .AddEmbeddedLocalization<Startup>()
        .AddApplicationInsightsTelemetry()
        .AddHttpContextAccessor()
        .AddMemoryCache()
        .AddCmsTagHelpers() //Epi Tag-helpers
        .AddSitemaps(x => //geta sitemaps
        {
            x.EnableLanguageDropDownInAdmin = false;
            x.EnableRealtimeCaching = true;
            x.EnableRealtimeSitemap = false;
        }, p => p.RequireRole(Roles.Administrators)).AddSitemapsCommerce()
        .AddCustomFindServices(_config);//register custom find services, run at the end.

    services.AddControllersWithViews()
          .AddNewtonsoftJson(options =>
          {
              options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; //Avoid runtime errors serializing page ViewModels with a page reference.
          })
          .AddMvcOptions(options => options.Filters.Add(
              new ResponseCacheAttribute
              {
                  NoStore = true,
                  Location = ResponseCacheLocation.None
              }));

    **services.AddODPVisitorGroups();**
    services.AddTinyMceConfiguration();
    services.AddSingleton<IActionContextAccessor, ActionContextAccessor>();

    //Run last to override built in Epi Cart Validation as it doesn't function correctly in Commerce 14.  
    services.AddTransient<OrderValidationService, CustomOrderValidationService>();

    services.AddCors(options =>
    {
        options.AddPolicy("AllowAll", builder =>
        {
            builder.AllowAnyOrigin()
                   .AllowAnyMethod()
                   .AllowAnyHeader();
        });
    });
}

How we check if a user matches a visitor group on our debug page:

private List GetVisitorGroupByCurrentUser()
{
var filteredVisitorGroup = new List();

var user = HttpContext.User;
var visitorGroups = _visitorGroupRepository.List();
foreach (var visitorGroup in visitorGroups)
{
    if (_visitorGroupRoleRepository.TryGetRole(visitorGroup.Name, out VisitorGroupRole virtualRoleObject))
    {

        if (virtualRoleObject.IsMatch(user, HttpContext))
        {
            filteredVisitorGroup.Add(visitorGroup.Name);
        }
    }
}

return filteredVisitorGroup;

}

I have gotten the 'is in segment' to work, but not the 'Customer property - Text' nor 'Customer property -Number' criteria. Do you have any idea why these criteria are not working?

Audience (Visitor Group) based on RTS is working backwards

I've created an Audience (Visitor Group) based on an ODP RTS. When I assign that Audience to content in the CMS, it's showing/hiding the content based on the opposite of the rule (showing the content if NOT a member of the RTS, and hiding when you ARE a member).

For ex:

  • RTS "searched for shoes", based on a search event with search_term "shoes"
  • Visitor group based on belonging to that RTS
  • Assign that visitor group to a text block on a page
  • Go to website in incognito browser

Expected result:

  1. Don't see the text block
  2. Fake a search for "shoes" -- zaius.event('navigation', { action: 'search', search_term: 'shoes' });
  3. Reload the page
  4. See the text block

Actual result:

  1. See the text block
  2. Fake a search for "shoes" -- zaius.event('navigation', { action: 'search', search_term: 'shoes' });
  3. Reload the page
  4. Don't see the text block

Looking at the code, the issue appears to be here:
https://github.com/unrvld/ODP.VisitorGroups/blob/main/src/UNRVLD.ODP.VisitorGroups/Criteria/CustomerDataRetriever.cs#L136

It will return TRUE (edges.count == 0) when you're not a member, and FALSE (edges.count == 1) when you are a member.

About to submit a PR for review.

Vuid not found issue

I have observered that some customers that are part of a Real Time Segment in ODP are not being matched to a paired CMS visitor group.

I have debugged the issue via the GraphQl explorer and uncovered that when this happens, their vuid does not exist in ODP... and I also note that your library tries to match customers to ODP Real Time Segments (or audiences) by their vuid.

I'm not quite sure what's going on here. My best guess (and I could well be wrong) is that when ODP stitches customer records across different sessions, devices, browsers etc, it discards all but one of the vuids. If the vuid I have stored in my cookies is not the one kept against my customer record in ODP then I cannot leverage personalization via your package.

Not sure I'm making sense... so here's an example...

Joe Bloggs visits a website on his phone. This website is using OPD and Optimizely CMS and linked-up using your package. When he visits the site for the first time, this creates a cookie with a 'vuid' in his phone and sends its value to ODP with all subsequent requests. Joe later registers on the site and his email is captured in ODP. At this point, Joe's customer record in ODP contains his email and his 'vuid'.

Later on, Joe visits the same website on his desktop. This creates a new cookie with a new vuid in his desktop and sends this to ODP with all subsequent requests. Joe then signs-in on the website via his desktop and his email is again captured in ODP. At this point, ODP has two 'vuid' values that can be attributed to Joe Blogs' customer record.

If ODP keeps the value from his phone against his customer record (and discards the other), then when he browses from his desktop, he will never match the odp audience and never get a personalized experience via the cms visitor groups.

Does this all make sense? Am I missing anything?

This would seem like a big problem with ODP and personalization, i.e. not being able to do personalization across different channels.

I think for your package to get around it, ODP would need to expose a list of vuids against each customer and allow your package to query that.

Is there a way around it that you can see?

Thanks in advance

Dan

ODP.VistorGroups doesn't work with RestSharp 1.0.8

We've recently updated our solution to the latest version (1.0.8) of RestSharp but now can no longer access the VistorGroups tab in the CMS.
When I remove this package I can access visitor groups as expected.

The error we receive is:
Could not load file or assembly 'RestSharp, Version=107.3.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.

Capture

Some GraphQL queries are inefficient

A client of mine is looking into using this add-on. During testing, I have found some queries to be slow and wrote some changes.

However, I am missing push access to push a feature branch in order to make a PR.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.