Support » Plugin: Popups - WordPress Popup » Is there a JS callback that closes and sets cookie on validation?

  • digi57


    I a using a form provided by a company that does online booking, customer relation management, smart marketing, etc. The form connects to their API and has the following Javascript that validations API connection success:

    $(document).ready(function() {
    var formdata = $(this).serialize();
    url: ‘/OpportunityAPI.php’,
    type: ‘POST’,
    data: formdata,
    success: function(msg) {
    alert(‘Opportunity successfully created!’);
    alert(‘Something went wrong. Please check the Configuration !’);

    return false;

    Is there a callback where I can replace “alert(‘Opportunity successfully created!’);” with a callback that sets the conversion cookie and closes the popup?

    • This topic was modified 1 month ago by digi57.
Viewing 1 replies (of 1 total)
  • Plugin Support gonzalesc



    First, your script must dependent on public/assets/js/public.js
    So you can use the SPU functions like this example:

    // Close popup with ID 15 and conversion
    const $popup_id = 15, $conversion = true;
    SPU.hide($popup_id, $conversion);


Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.