Try our conversational search powered by Generative AI!

K Khan
Mar 31, 2016
  2175
(1 votes)

Promotions That Drive Customer Engagement - Part2

A successful online promotional campaign is depending on 3 vital steps i.e.

Effective promotional strategy
Segmenting and targeting your clients
Evaluating promotions and correcting them

A successful promotional campaign requires a well though strategy to target every potential customer. For the best results businesses targets specific offers to the right people at the right time. At the same time evaluating your promotional campaigns, including client’s behaviour, profit margins or desired customer engagement can make a huge impact. Introducing user specific coupon codes is one of the ways to achive this.

Businesses usually have to find the best Ecommerce solution that fits with their business requirements and have to rely on that with very less customization. EPiServer’s new promotion system is potentially able to resolve any complex promotion scenarios that a business will be looking to achieve their business goals and can fit with any promotional model. 

How promotion system overall works?

Image custompromotions.PNG

Promotion Data (inherit EntryPromotion, OrderPromotion or ShippingPromotion): This is the model that makes up the promotion. In our case this is the visitor group we need to match and the discount percentage to apply to the order

Promotion Processor (inherit PromotionProcessorBase<T>): This processor evaluates eligibility for the promotions and returns an instance of IPromotionResult Promotion Result (implements IPromotionResult) This is returned by our processor and does the work of applying the promotion

Promotion Engine (inherit EPiServer.Commerce.Marketing.PromotionEngine): Evaluates the condition on all active promotions and gives reward to specific orders when the conditions are fulfilled.

New promotion system is capable to handle most complex promotion situations also even if those are not available out of the box. As even we can create our own custom promotion engine also if existing one is not fitting well with the current business.

How to create a custom promotion?

Best example so far is, http://www.david-tec.com/2015/07/creating-a-custom-promotion-with-the-new-episerver-commerce-9-promotion-engine-beta---part-1

How to create a custom promotion engine? *

You will require to implement a CustomPromotionEngine Class Inherited from EPiServer.Commerce.Marketing.PromotionEngine and register your CustomPromotionEngine for IPromotionEngine at site initialization

public class CustomPromotionEngine : EPiServer.Commerce.Marketing.PromotionEngine
    {

        public CustomPromotionEngine(EPiServer.Commerce.Marketing.PromotionProcessorResolver promotionProcessorResolver, 
            IContentLoader contentLoader,
            EPiServer.Commerce.Marketing.CampaignInfoExtractor campaignInfoExtractor,
            EPiServer.Commerce.Marketing.RewardApplicatorResolver rewardApplicator,
            EPiServer.Commerce.Marketing.IAdditionalPromotionInformationCreator additionalPromotionInformationCreator,
            EPiServer.Commerce.Marketing.ICouponFilter couponFilter, 
            ReferenceConverter referenceConverter) :
            base(promotionProcessorResolver, contentLoader, campaignInfoExtractor, rewardApplicator, additionalPromotionInformationCreator, couponFilter, referenceConverter)
        {
        }

        public override IEnumerable<RewardDescription> Run(Mediachase.Commerce.Orders.IOrderGroup orderGroup)
        {
        }
    }

How to add a coupon code into cart? *

Coupon codes stored via MarketingContext.Current.AddCouponToMarketingContext will not be processed via promotion engines. Instead, IOrderForm have a new property CouponCodes that can be used to record all the coupon codes applied on order. Promotion engine will process the IOrderForm.CouponCodes e.g.

(CartHelper.Cart.OrderForms[0] as IOrderForm).CouponCodes.Add("CoupoCode");

How to evaluate your coupon usage for reporting?

public class CustomCouponUsage : ICouponUsage
{
    public void Report(IEnumerable<PromotionInformation> appliedPromotions)
    {
        foreach (var promotion in appliedPromotions)
        {
            var code = promotion.CouponCode;
            //RedeemCouponCode class is a DDS based class to store entries for used coupons
            RedeemCouponCode red = new RedeemCouponCode();
            red.Color = "Red";
            red.CouponCode = code;            
            red.Redeem();
        }
    }
}

* It is tested on EPiServer Commerce 9.10.0, It may be different on older versions, This area is subject to change as is available in Beta mode.

Please note, this post is part of my research on new promotion systems and is not based on real time implementation, Feel free to discuss if you find something is dodgy.

Part 1

Part 3: Working Custom Promotion Engine, Record used coupons [In Progress]

Mar 31, 2016

Comments

Please login to comment.
Latest blogs
Azure AI Language – Extractive Summarisation in Optimizely CMS

In this article, I demonstrate how extractive summarisation, provided by the Azure AI Language platform, can be leveraged to produce a set of summa...

Anil Patel | Apr 26, 2024 | Syndicated blog

Optimizely Unit Testing Using CmsContentScaffolding Package

Introduction Unit tests shouldn't be created just for business logic, but also for the content and rules defined for content creation (available...

MilosR | Apr 26, 2024

Solving the mystery of high memory usage

Sometimes, my work is easy, the problem could be resolved with one look (when I’m lucky enough to look at where it needs to be looked, just like th...

Quan Mai | Apr 22, 2024 | Syndicated blog

Search & Navigation reporting improvements

From version 16.1.0 there are some updates on the statistics pages: Add pagination to search phrase list Allows choosing a custom date range to get...

Phong | Apr 22, 2024