Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

K Khan
Mar 31, 2016
(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,

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;            

* 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


Please login to comment.
Latest blogs
Enhancing online shopping through Optimizely's personalized product recommendations

In this blog, I have summarized my experience of using and learning product recommendation feature of Optimizely Personalization Artificial...

Hetaxi | Jun 18, 2024

New Series: Building a .NET Core headless site on Optimizely Graph and SaaS CMS

Welcome to this new multi-post series where you can follow along as I indulge in yet another crazy experiment: Can we make our beloved Alloy site r...

Allan Thraen | Jun 14, 2024 | Syndicated blog

Inspect In Index is finally back

EPiCode.InspectInIndex was released 9 years ago . The Search and Navigation addon is now finally upgraded to support Optimizely CMS 12....

Haakon Peder Haugsten | Jun 14, 2024

Change the IP HTTP Header used for geo-lookup in Application Insights


Johan Kronberg | Jun 10, 2024 | Syndicated blog