Pawan Singh
Jul 21, 2025
  591
(0 votes)

Optimizely Forms: Forcing New Submission on Every Post

By default, Optimizely Forms uses browser cookies to track submissions and updates the existing submission if the same user submits the form again. While this behavior works well in most scenarios, we had a custom business requirement: for certain forms, each submission needed to be treated as a new entry, regardless of whether it came from the same user or browser session. At the same time, all other forms in the solution were expected to retain the default cookie-based behavior.

Initially, this seemed complex
, but after inspecting the Optimizely Forms framework, we discovered that the ProgressiveSubmitInfoService class could be leveraged to inject this behavior in a clean and maintainable way, as shown below.

using EPiServer.Forms.Core.Internal;
using EPiServer.Forms.Core.Models.Internal;
namespace alloy_example.Customization.Forms;

public class ExtendedProgressiveSubmitInfoService : ProgressiveSubmitInfoService
{
    public override ProgressiveSubmitInfo GetProgressiveSubmitInfo(Guid formContentGuid, HttpContext httpContext,
        string formLanguage)
    {
        //var isPathFound = httpContext.Request.Path.StartsWithSegments(RootPath); // e.g. can be checked based on httpContext 
        if (!string.IsNullOrEmpty(httpContext.Request.Form["TestElement"]))
        {
            return null;
        }
        return base.GetProgressiveSubmitInfo(formContentGuid, httpContext, formLanguage);
    }
}

Above code check if Element TestElement is found under httpContext after submission, this it will simply return null and forcing optimizely framework to generate new submissionId for given form submission.

As last step, make sure to register in DI container as below.

using EPiServer.Forms.Core.Internal;

services.AddSingleton<ProgressiveSubmitInfoService, ExtendedProgressiveSubmitInfoService>();

This overrides the default service and enables custom logic while keeping the framework's core behavior intact.

Hope, it helps someone!

Jul 21, 2025

Comments

Please login to comment.
Latest blogs
Install the new AI Assistant Chat for Optimizely

AI Assistant Chat is a revolutionary feature introduced in version 3.0 of Epicweb.Optimizely.AIAssistant that brings conversational AI directly int...

Luc Gosso (MVP) | Feb 12, 2026 |

Building a TwoColumnWideLeftSection in Optimizely CMS 13 Visual Builder

This post walks through a practical “66% / 33%” section built for Visual Builder using the composition tag helpers: , , , and . Visual Builder is...

Francisco Quintanilla | Feb 12, 2026 |

Advanced Form Submissions for Optimizely CMS 12

Managing form submissions in enterprise Optimizely CMS installations can quickly become inefficient. While the default Optimizely Forms submission...

Adnan Zameer | Feb 12, 2026 |

Personalisation in CMS 13 Using Audiences

One of the common questions around CMS 13 is whether it still supports personalisation without requiring additional products. The short answer is...

Minesh Shah (Netcel) | Feb 12, 2026