How to Keep Parameters After a Popup Redirects your Visitors?

If your URL contains any parameters (Ex.: utm parameters) before the popup redirects you to another page and if you want to keep these parameters after the popup redirection, just insert the following code snippet into the JavaScript editor of the popup:


<script type="text/javascript">
$(document).ready( function() {
      $(function () {
          var $redirectButton = $('.OM-conversion-action');
          var originalRedirectUrl = $'redirecturl');
          var parentUrl = OptiMonk.Vars.parentUrl;
          var aTag = document.createElement('a');
          aTag.href = parentUrl;
          var urlParams =,;
          var baseATag = document.createElement('a');
          baseATag.href = originalRedirectUrl;
          var firstCharAfterUrl = ? "&" : "?";
          var newRedirectUrl = originalRedirectUrl + firstCharAfterUrl + urlParams;
          $redirectButton.attr('data-redirecturl', newRedirectUrl);

Have more questions? Submit a request