Assurex's Sandeep and Saurabh are recognised as Sitecore Most Valueable Professionals Find out more         
MarketingAutomation
Commerce Development Get It Right Marketing Under The Hood

Sitecore Commerce Marketing | Under the hood – Part 3

Marketing Automation in Sitecore allows automating relevant communications, leveraging visitor’s interactions captured in the xDB. How does it all work in Sitecore Commerce? Let us find out in the third blog of the 4-blog series and see how Sitecore Commerce Marketing Automation works under the hood.

Simply put, the Commerce Marketing Automation plan allows you to engage customers throughout their commerce journey.

How to get MA up and running?

  1. Add Commerce MA campaign modules during Site Creation

  2. Or to an existing site, using the ‘Add Site Module’ script

So, what’s under the Hood?

Now that you know how to get MA included in your Site, let us see what happens under the hood.

Like I mentioned in the previous blogs, all the action takes place independent of the actual commerce platform which means….at the Commerce Connect.

The Configurations

If you head to \App_Config\Include\Connect.MarketingAutomation in your Sitecore Commerce deployment, you will see a set of configs which makes it happen under the hood.

Let’s break things down

Sitecore.Commerce.MarketingAutomation.config

We have the Default implementation dynamically getting loaded based on the following configuration.

<configuration xmlns:patch=”http://www.sitecore.net/xmlconfig/”>  <sitecore>
   <automationProvider type=”Sitecore.Commerce.MarketingAutomation.Providers.AutomationProvider, Sitecore.Commerce.Connect.MarketingAutomation” singleInstance=”true”/>
  </sitecore>
</configuration>

How do I extend it?

Just implement IAutomationProvider interface and change the above configuration to extend the OOTB providers

Can you describe with an example? Why not?

A sellable item is added to the cart

Actions that affect the cart are configured in Sitecore.Commerce.MarketingAutomation.Carts.config

Notice the following configs and let us see what happens when a product is added to a cart

Let’s see what is happening here

  1. The value provider processes the entity in question and returns the key/value pair to be processed further
  2. The pipeline gets fired when a product is added to the cart
  3. A processor to update the user in the automation plan is called
  4. The entity is processed using the value provider at step 1
  5. It instructs the system to put the contact into the Abandoned Cart automation plan
  6. Tells the system not to allow for duplicates
  7. And the user is added only if they are authenticated otherwise there is no way to send reminder emails to unknown users

What happens if the user has completed the purchase?

In the previous section, we saw that every time a sellable item is added to the cart and if the user is known the cart and the user is added to the abandoned card automation plan. Now, what if the user completes the purchase.

Actions related to orders are configured in Sitecore.Commerce.MarketingAutomation.Orders.config.

Here is the snapshot for the same

Let’s see what’s happening here

  1. The value provider processes the entity in question and returns the key/value pair to be processed further
  2. The pipeline gets fired when the user submits an order
  3. The processor in question is ‘RemoveVisitorFromAutomationPlan’
  4. The name of the plan where the visitor needs to be removed
  5. Since the visitor has completed the purchase their information is needed for the NewOrder automation plan and hence processor ‘UpdateVisitorInAutomationPlan’ is executed
  6. Value provider as configured at step 1, processes the entity
  7. And the user is placed into New Order Placed Plan
  8. Duplicate contacts are allowed since the same people can place multiple orders
  9. And unauthenticated contacts are allowed as their email addresses will be known after an order is placed.

Extensions

You can write a custom processor by inheriting from abstract class ‘CartPipelineProcessor’ which implements the base pipeline processor, ‘PipelineProcessor’.

The Visuals

Here is the screenshot of the new order placed Automation plan which is self-explanatory and you can see the 2 orders have been created in the system and are placed in the automation plan.

In my talks and in all my blogs, I emphasize not to fight the architecture provided by Sitecore. Even if you are looking to add more features to the platform do so by means of extensions. This way your solution will be compliant and XP features with XC are assured to work, realizing the Return On Investment for the customers

If you have any questions or need any clarifications, please reach out to me and I will be happy to help. I will soon release the final blog in this series in which we will look at the Sitecore Commerce reports. If you haven’t looked at other blogs in this series, please see part 1 and Part 2 here.

External Reference – How to setup Commerce Marketing Automation Campaign

Did you find this useful? If so, please share with your connections.

Leave a Reply

Your email address will not be published. Required fields are marked *