Saturday 31 July 2021

Goal Trigger on forms submit

 

Goal Trigger on forms submit:

  • Create a Sitecore form.
  • Select Submit button.



  • Click on the "+" icon and select the "Trigger Goal".


  • It will open the modal popup and select the Goal which has you created and click on the "Ok" button.


  • Now you can see the selected goal, Click on Apply button and publish the forms.


  • Once you submit the forms then it will update the Analytics dashboard.



Associate a goal with page items

 

Associate a goal with page items:

You can associate a goal with a content item in the Experience Editor or in the Content Editor. You use the Media Library or Content Editor to associate a goal with a media item.

To associate a goal with an item:
  • From the Sitecore Launchpad, open the Experience Editor or the Content Editor, then navigate to the relevant content item.
  • In the Attributes group, click Goals.
    • In the Experience Editor, this is located on the Optimization tab.


    • In the Content Editor, this is located on the Analyze tab.



  • In the Goals dialog, select the goal that you want to associate with this item and click OK.



Sitecore Goals

Goal

  • Goals are activities that visitors can perform on your website. You create goals to track and measure how visitors engage with the website and campaigns – both online and offline.
  • All goals are events, but not all events are goals.
  • Goals can be “tagged” on specific pages on your website.
In this demo, we have to learn how to create goals and associate with Page Items or Goal Trigger on forms submit in Sitecore.

Create and deploy a goal

  • In Marketing Control Panel, in the content tree, click Goals.

  • On the Home tab, in the Insert group, click Goal to create a new goal.


  • In the dialog box that appears, enter a name for the goal.


  • On the Content tab, you can enter more detailed information about the goal, such as engagement value points or a description.


  • Click on the Save button.
  • To deploy the goal, on the Review tab, in the Workflow group, click Deploy.


    Now you can associate the goal with content items and campaigns.
  • To publish the goal, on the Publish tab, in the Publish group, click Publish.


Associate a goal with page items


Email Experience Manager (Automated) - Quick Setup


Email Experience Manager


Use the email experience manager (EXM) to create highly customizable email campaigns and make them both personal and relevant to your customers.

Email experience manager does not support CMS-only mode.

Email Experience Manager (EXM), there are two types of email campaigns and each has a set of templates that contain default content and layout.

  1. Regular email campaign - This type does not have any predefined content or recipients, so you create this type of email campaign from scratch. 
  2. Automated email campaign – This type is used to send a single email to one contact at a time.
Out of the Box, Sitecore enables EXM by default and sets up the Mail Distribution provider as the CustomSMTP provider. However, the provider settings must be set up in order to send an email. This post will dive into how to set those settings. I will explain how to set up the EXM module in Sitecore 9.x for dev machine usage.

1. Custom Email SMTP configuration: To send the email from Sitecore, you just need to configure the SMTP server, I am using MailTrap.io SMTP settings.

  • Set up MailTrap.io account: Mailtrap is a fake SMTP server to test, view, and share emails sent from the development and staging environments. It allows you to test email notifications without sending them to the real users of the application. All emails sent to Mailtrap are held in your Mailtrap inbox where you can test, view, and share with your team. To create an account, visit https://mailtrap.io and signup.

  • Once set up, you can see SMTP settings.

2. The EXM configuration settings: In this section, we will do all required configuration changes.
  • Now go to web.config file of the root folder of the application. Search the key called “eds:define” in the web.config and make sure the value should be “CustomSMTP”.



  • Go to \App_Config\Sitecore\EmailExperience\Sitecore.EDS.Providers.CustomSMTP.config




  • Update the SMTP setting in the smtpSetting node as below.



3. Testing Your MTA Connection: On any Sitecore EXM Manager Root item, there is a Test Connection button in the Content Editor.




Clicking on this button will test your connection to your Mail Transit Authority (MTA). A successful connection to the MTA service will display the following.



4. Email Experience Manager Module: Now as all configurations are done, let’s play with the EXM module in Sitecore, and send your first email from the Sitecore application. Open the EXM module on the Sitecore dashboard.

  • Create the email campaign > Click create > Regular Email Campaign/Automated email campaign. We have created an Automated email campaign for this demo.

  • Once you click on "Automated" then the modal popup opens and you can select the default template or Import your HTML template or you select the exit page item then click on the "Create" button.


 
  • In the general information tab, you can configure some basic information of the email campaign for example name, description, etc, in the sender section you can configure “from name” and email, which will show in the email box.



  • In the Message tab, we can make the message template what looks like in the mailbox.

  • In the Delivery tab click on Activate to activate the campaign.






Friday 2 July 2021

Creating a custom pipeline in Sitecore

What is a Pipeline?


  • A pipeline is basically a method whose flow is defined using XML.
  • A pipeline consists of a sequence of processors. A processor is a .NET class that implements a method. When a pipeline is invoked, the processors are run in order.

What are Custom Processors?


While there is neither a class to extend nor an interface to implement, a convention must be followed in order for Sitecore to be in order for a class to be used as a processor:


  • If the processor has a method specified, the method must accept a PipelineArgs object and return void.
  • If the processor does not have a method specified, the processor must have a method named Process which accepts a PipelineArgs object and returns void.
The following is an example of a custom processor.
public class SetVal1
{
    public void Process(MyPipelineArgs args)
    {
        Sitecore.Diagnostics.Assert.ArgumentNotNull(args, "args");
        //do something
    }
}

Creating a Custom Pipeline

Creating custom pipelines is an essential part of integrating an external system with Sitecore.
  • PipelineArgs
  • Defining a Pipeline
  • Invoking a Pipeline

PipelineArgs


When creating a custom pipeline a custom PipelineArgs class is not required. The standard PipelineArgs class can be used.

However, a custom PipelineArgs class makes it easier to pass objects between processors and to provide output to the process called the pipeline. At runtime, the PipelineArgs object acts as the pipeline’s context.

In order to create a custom PipelineArgs class, you must inherit from Sitecore.Pipeline.PipelineArgs.

public class MyPipelineArgs : Sitecore.Pipelines.PipelineArgs
    {
        public string Result { get; set; }
    }

Defining a Pipeline


A pipeline itself is nothing more than a block of XML in the configuration > Sitecore > pipelines section of Web.config or a Sitecore patch file.

The following is an example of a custom pipeline definition.

<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <pipelines>
      <myPipeline>
        <processor type="SitecoreLearning.Helpers.CustomProcessor.SomeProcessor, SitecoreLearning" />
      </myPipeline>
    </pipelines>
  </sitecore>
</configuration>

Invoking a Pipeline


Create the processor class(es):

public class SomeProcessor
    {
        public void Process(MyPipelineArgs args)
        {
            args.Result = GetResult();    // Write a bussines logic here what are you want to implment.
        }

        private string GetResult()
        {
            return "Hello custom pipeline world";
        }
    }

To call the pipeline we use the CorePipeline.Run method as follows:

 var pipelineArgs = new MyPipelineArgs();
 Sitecore.Pipelines.CorePipeline.Run("myPipeline", pipelineArgs);  // Invoking a Pipeline
 Log.Info(pipelineArgs.Result, this);

This is how simple it is to create a custom pipeline.

Sitecore Publishing Service 7.0 Installation Guide

  About the Publishing Service module The Publishing Service module is an optional replacement for the existing Sitecore publishing methods....