Skip to main content

Sitecore 9 - Marketing Automation: Debugging Custom Marketing Automation Rules

We have seen implementation of a custom segmentation rule and marketing automation rule in previous post. The main focus was on segmentation rule but I also showed marketing automation rule implementation.

Basically, we need to implement ICondition interface and write our logic in Evaluate method. Since, I've already completed configuration and written my rule, we can create a marketing automation plan.


I added my rule and activated my marketing automation plan. Now, I want to test my custom rule. The easiest way to use "Repost view" button inside marketing automation page. Once the rule applies for a contact, then you should see that contact in the list.

Let's say it didn't work. You visited a movie 3 or more times and ended your session. Normally, at that moment, the contact should be added to list in your automation plan. But you didn't see anything.

We need to debug and see our fault in code.

To do this, first I am going to stop marketing automation service. I opened Task Manager and saw that two services are working. One for index and the other one is for marketing automation.



I stopped the marketing automation service. Then, I opened a cmd window, went to AutomationEngine path and run maengine.exe


Now I can find running process and attach for debugging in visual studio.


That's it! Now, we can debug our marketing automation related codes.

Next post:
  • Custom marketing automation activities (with Angular UI) Part-1Part-2

Comments

Post a Comment

Popular posts from this blog

Sitecore 9 - Custom Page Events & Filtering with XConnect

This is the first article of a series. I am going to start with creating a custom page event and will show how we can fetch event data using xconnect api. Let's start with reminding demo scenario: Imagine that you have a website displaying movies. Visitors are able to see movie details and take some actions like save movie or share it.  You want to follow the visitors' activities and you want to take some marketing actions based on those activities. For example, if a contact visits a movie more than X time or she/he saves a movie, you want to send those movies to an external system. In addition, there is going to be a limit to send same movie. Such as, it will not be possible to send same movie more than 2 times.  You want to configure this as a marketing automation plan to give flexibility to your marketing managers. They should be able to add configurable rules and activities.  My first focus is movie detail page. I want to track visitors when they visit the

A React Example in Sitecore

That's true, Sitecore components are useful and provide lots of facilities. They allow to build fully flexible website. And there is not much problem using post-backs to display your contents. However, if your website has user interactions, then it could be a headache. Too many post-backs would occur a poor user experience. That's why client-side technologies are really powerful and popular for a long time. There are plenty of javascript libraries and frameworks which all try to provide better user experience in different ways. It is not a topic of this article why I chose React. There are some good articles about it (e.g. Jonne Kats' great article ). However, one of the reasons is React only focus on view part. It is not a fully framework like Angular, it is rich featured library instead. And that's what I was looking for! The idea was to benefit Sitecore server-side and React client-side power. It seems they are very good match! Let's dive into code... I&#

Sitecore 9 - Creating Custom Segmentation Rule

Predicates are important to create rules for marketing automation and segmented lists. Before going through the details, I am going to remind what I am implementing again. Imagine that you have a website displaying movies. Visitors are able to see movie details and take some actions like save movie or share it.  You want to follow the visitors' activities and you want to take some marketing actions based on those activities. For example, if a contact visits a movie more than X time or she/he saves a movie, you want to send those movies to an external system. In addition, there is going to be a limit to send same movie. Such as, it will not be possible to send same movie more than 2 times.  According to my scenario, I need a rule to filter contacts who visits a movie more than X time. Maybe, we can add one more condition there like in Y days. To creating rule will give flexibility to marketing managers that then they can easily add or remove multiple rules and proceed the