Sunday, November 14, 2021

Sitecore Powershell Extension

 ØThe Sitecore PowerShell Extensions (SPE) is a module that provides a command-line interface and scripting environment to work with the Sitecore platform.

ØUsing the PowerShell extension we can perform various operations of Sitecore items, as well as allow access to Sitecore API. It looks and works in the same way as the Windows PowerShell utility. It also excels at reporting and task automation.

ØI’m going to use the SPE in Sitecore 10.1 and it’s out of the functionality here.

Where should we find SPE?




Powershell Console

ØThis tool provides a simple command-line interface in the same way as our windows Powershell. you can enter a single command at a time and see the output.

Powershell ISE

ØThe Sitecore Powershell ISE is a tool that can be used to create, edit, test and execute PowerShell scripts. It offers a very advanced and flexible scripting environment.

ØISE adds a GUI and more functions. Following are some of the functions that it provides over the PowerShell console.

1. Saving PowerShell scripts and the ability to open them later

2. Executing scripts with one click

3. Switching the current database

4. Switching the current user and language

5. Debugging

6. Ability to execute selected part of the script

The interface of PowerShell ISE


There are several things that can be done using the SPE module, which includes

1. Getting Sitecore Item

2. Getting child item

3. Get item by path

4. Get items from all languages and versions

5. Making bulk updates

6. Publishing Sitecore items

7. Deleting items based on specific conditions

Use cases for using SPE


Get all the items under the Sitecore node





Get-childItem "/Sitecore" | Format-Table -Property Name,Languages,Children,Id -AutoSize | Out-Default

Script to Change template of selected item

$props = @{

       InfoTitle = “Change template of items”

      PageSize = 10000

}

$sourcePath  = "/sitecore/content/Home/Homepage/Articles”

$items= Get-ChildItem -Path $sourcePath -ReCurse

 

Function Change-Template

{

     Foreach($item in $items)

     {

       If($item.TemplateId -eq “{843D7183-80B4-4F0B-BA97-6C79BFCE0C5E}”)

           {

                 $item.Editing.BeginEdit();

                 $item.TemplateId = “{B32C0EA5-EA98-4C07-874A-566C6462647D}”

                 $item.Editing.EndEdit();

                 Write-Host “Item id: ” $item.ID “ -Template id: “ $item.TemplateId

            }

       }

}

$items = Change-Template

$items | Show-ListView @props -Property ItemPath,ID

Close-Window

Why use session state elevation


ØThe concept actually sounds like more than it is, “SPE elevated rights” means that SPE has put a named token in your session state that has an expiration time.

ØWe are not elevating anything related to any other aspect of your Sitecore environment - you are “SPE elevated” which means we allow you to do execute the script and save it within your Sitecore environment.

Why session elevation?

ØShould a malicious actor be able to get a script onto your page. They would be able to execute a script as you would. This is why we’ve introduced the concept of session elevation.

How does the PowerShell script execute within my system?

Your PowerShell scripts can be introduced into the system in a number of ways. the most prominent ones are:

ISE :

Writing scripts in this Sitecore app is probably the most popular way you will provide the code for your authors.ISE allows you to write SPE modules and Apps utilizing its full power of creating user interfaces, reports, and dialogs.

Console

This app is a decent entry point when you need to quickly provide a one-liner to test something or just change a field in a large number of items.

Saved Scripts

SPE allows you to save scripts as Sitecore items that can be utilized by a number of “Integration points”.By saving your script in a proper location, you can expose your scripts in various places in the Sitecore user interface, such as the content editor context menu, ribbon, or even use them in workflow actions.

Remoting

This allows you to execute a script by sending it to a web service.


Monday, November 8, 2021

Sitecore Products

 

Sitecore XP:


Sitecore® Experience Platform™ is the digital experience platform providing personalization, machine learning, and marketing automation.


Sitecore XM:


Sitecore Experience Manager™ is the content management system (CMS) providing multilingual, multicultural, multichannel, and multisite content management.


Sitecore xDB:


Sitecore® Experience Database™ is the database that connects to Sitecore XM providing data interchange, encryption, and real-time insights.


Sitecore EXM:


Sitecore Experience Email Manager is a channel of delivery within the Sitecore platform.


Sitecore FXM:


Sitecore Federated Experience Manager is the channel that allows you to connect your non-Sitecore hosted websites to keep consistency between the sites.


Sitecore XC:


Sitecore Experience Commerce™ is the product that provides for integrated and personalized shopping experiences on your website.


Sitecore PXM:


Sitecore Print Experience Manager is the channel that provides web-to-print capabilities in your Sitecore platform.


Sitecore xEditor:


Sitecore Experience Editor is a core functionality within the Sitecore platform, which enables the editing function.


Sitecore xProfile:


Sitecore Experience Profile™ is a core functionality within the Sitecore platform, which houses the profile data.



Sunday, October 24, 2021

 Sitecore session state

 ØWhen contacts browse a website, data about their interactions with Sitecore is stored in session state until the end of the session, when it is committed to xConnect.

ØxConnect then updates information about the session, and any changes in the contact's data, in the analytics and contact database.

ØIt is, however, possible for a single contact to have two or more sessions on the same website at the same time. This can happen when a contact is using different devices or multiple browsers on the same device.

ØYou must have a session state server to keep track of all of the concurrent sessions for the contact.

Session state types

Private

ØContains information about contact visit information, such as pages viewed, goals converted, or campaigns triggered. Private session state is private to the browser accessing the website.

ØIf a contact accesses a website simultaneously from their desktop and mobile phone, each device will have its own private session state.

ØThe default timeout of private sessions is 20 minutes.

Shared

ØContains information that can be shared across multiple active sessions. This includes any contact information that has been loaded into the tracker at the start of the session.

ØThis includes, for example, data related to contacts and devices. This data is still private to the contact but it is accessible from all current sessions made by the same contact.

Session state processes

You can configure both private and shared session state as either in process (InProc) or out of process.

In process

ØThe default session state provider that comes with the Microsoft .NET Framework. It uses internal memory to track interactions and visits.

ØIt is the most suitable way of handling private session state for all data related to a specific interaction (single visitor session or visit). It is the recommended mode to use for CM servers.

Out of process

ØOut of process means that you use an external ASP.NET session state provider. Sitecore comes with the following session state providers for configuring out of process session state:

1. Sitecore ASP.NET Session State Provider for Redis.

2. Sitecore ASP.NET Session State Provider for Microsoft SQL Server.

ØFor shared session state, if you have two or more CD servers you must use out of process.

ØOut of process is not supported on CM servers.

 Get More Details here https://doc.sitecore.com/en/developers/101/platform-administration-and-architecture/scaling-and-configuring-session-state.html

Friday, October 22, 2021

Sitecore Synthesis ORM

 ØSynthesis is an object mapping framework for Sitecore that enables the development of more reliable and maintainable sites in less time than traditional Sitecore development.

ØIt is a strongly typed template object generator that is easily understandable for developers with either a Sitecore or traditional .NET background.

ØIt neatly integrates with Sitecore MVC (via the Synthesis. Mvc package) as a View rendering model provider and IoC dependency for controller renderings.

You can see the complete details here https://github.com/blipson89/Synthesis

Sample Code here: https://github.com/ArulPushpam/Sitecore-Synthesis/tree/master/code  

Demo

Step 1:

ØCreate new folder under Foundation

 ØInstall Nuget and it will generate the default config files in your solution




Step 2:

ØCreate a new class  BaseHelixModuleRegisteration


Step 3:

ØRegister your layers  

FeatureModelRegistration,FoundationModelRegistration , ProjectModelRegistration




Step 4:

ØCreate a new config file to patch our custom models

ØThe folder structure should be


ØPlease register your layer details here


Special Note

ØYou should enable this config file if you use an identity server for your Sitecore instance.Initially, it should be disabled



Step 5:

ØI have only two feature modules Events, Navigation for generating synthesis model.

ØAdd the project reference


ØIt’s time to register our synthesis with our module



Step 6:

ØRequired config has been done , lets move to generate synthesis model

ØGo to

https://sitecoreinstance/synthesis.aspx

Special Note

ØIf you can’t find the highlighted button please check your web.config file

ØWe needs to set true then only you can see the button.If you are in Prod instance we wouldn’t set the true .

Step 7:

ØModel has been generated and we can see the model now.


Special Note

ØIf you want the model at different path, you can define that in BaseHelixModuleRegisteration 


Step 8:

ØLet’s see the created model by synthesis

ØThis is my logo property from my events synthesis model

Special Note

ØWhenever we made the changes on templates synthesis automatically generate the model in your code. We have already defined those setting in this config



















 

Tuesday, September 21, 2021

Explore the Path Analyzer

 







ØThe Path Analyzer is an application that allows Digital Marketers  to view the various paths that contacts take as they navigate through a website.

ØMore specifically, we can see the paths that contacts take when they achieve goals and interact with campaigns, giving insight into which paths provide the best engagement value per conversion and which paths are less efficient and could use optimization.



ØHere, We can know more about the page path which has the highest engagement values . But I didn’t configure the goals and engagement values, so I didn’t get values here.

Configure the Path Analyzer Map






Go to Path analyzer

But the new map is not enabled here.

Why?

You deploy new maps using a workflow process. Once you have deployed a new map, it enters a system queue within the xDB. The system processes new maps once every 24 hours, so if you have multiple new maps, you should deploy them simultaneously using the Deploy action within the Workbox. Please consult your Sitecore System Administrator if you do not see the data for your new maps after 24 hours.

 

Campaign Code



ØApplying a campaign code to external websites enables to gather of more detailed information about campaign traffic and efficiency by using the dashboards in Sitecore Experience Analytics.

How to Apply a Campaign Code to an Online Campaign


Steps to follow when using a PowerShell script to modify the goals in Sitecore

I have previously utilized PowerShell for item creation, modification, deletion, and presentation details in Sitecore.   Ø Recently, I attem...