0

I am having requirement to show personalized content for Logged-in user (external system) which have default persona attached to user profile and after logged-in need to show personalized content on the basis of default mapped user persona.

For example, 2 persona presents like A and B in Sitecore, and user mapped to persona A in CRM side, so content related to Persona A needs to be shown always after logged-in, not Persona B (persona needs not be changed while user active on site).

Sitecore persona's already created and Content also mapped. For annonymous user I already verified both the personas in Sitecore JSS app and it's working fine.

Ask here are:

  1. How to login via external IAM system, so that user context created in Sitecore including persona attribute (which contains Persona A or PersonaB) set to user profile for future use? In vanilla Sitecore we usually create Virtual user and setting the value like : profile.Persona = "Persona A"; where "Persona" is custom User Profile's attribute.

  2. Is Sitecore contact would be automatically created after virtually login (Step-1) into Sitecore or need to write custom code (Server side or JSS code) to create Sitecore contact?

  3. How to implement sign-out after logged-in and also how Sitecore contact become unknown?

  4. The user profile already mapped to one persona e.g. Persona A in CRM system and getting these details after login. Now after login need to show only Persona A related content not Persona B ( if user falls after traversing required pages).

  5. How the tracking of logged-in user will happen? Need to write custom code ( Server side or JSS code) as mentioned at Share Sitecore content to Native Mobile Apps (IOS swift and Android java)?

Update-1:

  • With the help of custom controller in ASP.NET MVC, able to implement virtual login and creation of Sitecore contact.

  • I am able to create virtual user, sitecore contact:

    • After virtual login the user, i am able to verify Personalization with OOTB rule “where the user profile includes a valid email address” and its showing Personalization content after refreshing the current page.
    • After Login, contact being created in the Sitecore

    Pending Issues:

  • How to login via external IAM system, so that user context created in Sitecore including persona attribute (which contains Persona A or PersonaB) set to user profile for future use? In vanilla Sitecore we usually create Virtual user and setting the value like : profile.Persona = "Persona A"; where "Persona" is custom User Profile's attribute.

  • How to set Persona coming from CRM into User profile after login so that always default persona would be picked by the Sitecore?

  • After login if user traverse other page and coming back to page where personalization implemented, it’s not showing personalization content (rule “where the user profile includes a valid email address”) but if I again refresh the page then It’s showing the personalization content.

Update-2:

  • With the help of custom controller in ASP.NET MVC, able to map default persona coming from CRM to user profile and personalized content showing to user after login on the basis of default mapped persona but it's changing when user traverse the site and mapped with other defined presona.

    Pending Issues:

  • How to login via external IAM system, so that user context created in Sitecore including persona attribute (which contains Persona A or PersonaB) set to user profile for future use? In vanilla Sitecore we usually create Virtual user and setting the value like : profile.Persona = "Persona A"; where "Persona" is custom User Profile's attribute.

  • How to set Persona coming from CRM into User profile after login so that always default persona would be picked by the Sitecore and will not change while traversing the site also?

  • After login if user traverse other page and coming back to page where personalization implemented, it’s not showing personalization content (rule “where the user profile includes a valid email address”) but if I again refresh the page then It’s showing the personalization content.

Some findings: I am using Sitecore Virtual user logic to make user login in Sitecore and creating the Sitecore contacts. After refresh only logged-in user rule (OOTB rule - “where the user profile includes a valid email address”) working and showing personalized content. I checked the request/response and found that when I refresh the page then in Request Header > .AspNet.Cookies being added and in the response Sitecore > Context > User > Domain and name coming but these values in request/response not coming when user traverse the page. Any suggestions, how to set these missing header cookie or resolve this issue?

Any suggestions to implement above scenario?

  • Have you looked into the Universal Tracker? – Pete Navarra Jun 13 at 12:24
  • I am using Sitecore JSS and assuming that Universal Tracker used to collect users interaction and can't return the Personalized content. – Amit Kumar Jun 19 at 14:39
0

You start with creating persona profiles with two profile keys A and B. If CRM is doing clastering of users and always return one persona or another than you set your decay rate on profile to 100%. This will mean that historical values (values saved during previous sessions), you have in profile will not affect current session. If you think that you have more relevant info in Sitecore to drive personalization - you can play with decay rate. Next, once you login, I would assume you reading CRM profile and getting info about persona. You'll need to write code that saves some value into one or another Persona profile key. Again, you can set Max value in you scale or some percent depending on what you want to archieve.

To log off - you need to finish your session.

Layout service will you cookies to track your session. For mobile this might be a challenge, though. Most likely you need to pass some token (like OAuth) to restore information about user and seeing able to identify him.

  • Persona already created in the Sitecore, lets say A and B. As per information shared by you, I have to write custom code for this in Server side, so that user can virtually logged-in, contact created, set user profile with any of the default persona coming from CRM, etc.? – Amit Kumar May 13 at 4:38
  • I am able to create virtual user, sitecore contact and logout: >After virtual login the user, able to verify Personalization with OOTB rule “where the user profile includes a valid email address” and its showing Personalization content after refreshing the current page. >After Login, contact being created in the Sitecore. >After Logout, virtual user being logout. >Tried accessing the above functionality (Login/Logout) over the HTTPS/HTTP >Cookie “SC_ANALYTICS_GLOBAL_COOKIE” present for anonymous and logged-in user, and it’s not changing. – Amit Kumar May 13 at 11:49
  • >As per my understanding "tracking=true" parameter by default being passed. Issue currently, I am facing that after login if user traverse other page and coming back to page where personalization implemented, it’s not showing personalization content (rule “where the user profile includes a valid email address”) but if I again refresh the page then It’s showing the personalization content. – Amit Kumar May 13 at 11:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.