• Resolved George

    (@giorgos93)


    Hi! I have a popup window, that can be closed either by a close (x) icon, or a button press inside the popup. After that, this popup won’t be opened again for 1 day.

    My question is: can I set different cookie expiration time for these 2 elements? For example, 1 day, if a user closed a popup. And 7 days, if the user clicked the button.

    And if it’s not possible, then could you consider adding this option? Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Bel

    (@belimperial)

    Hi George,

    Thank you for getting in touch.

    The cookies can be trigger by the following
    – On Popup Close
    – On Popup Open
    – Form Submission
    – Manual Javascript

    Currently, by element is not yet supported on the cookie events option.

    You can submit a feature request using this link here. That way, you can monitor the feature request, and at the same time you can leave a comment on the feature request.

    We hope that helps. Let us know if you have questions.

    Thread Starter George

    (@giorgos93)

    Hi, @belimperial , thanks for the answer!

    I’d like to clarify: I have a popup_close tag=”div” added to the button in my popup window. Does it mean, that it counts as popup close, or a popup open? If it’s a popup close, then is there any other tag, that can be added, so it counts as a popup open?

    If yes, then I’ll change the tag. And add another cookie for a popup open (atm I have only for popup close). And there will be a close icon with popup close cookie, and a button with popup open cookie. And I can set different expiration time for each. Right?

    Plugin Support Kim L

    (@kimmyx)

    Hi @giorgos93,

    We have a documented guide on how to create a cookie upon clicking an element inside your popup. However, it requires coding as it utilizes the “Manual/Manual Javascript” option.

    Here it is: Create Cookie On the Click of an Element Within Your Popup

    Let us know if this helps!

    Thread Starter George

    (@giorgos93)

    Hi, @kimmyx thanks for the advice! A read this article, and understood how to do it, I think.

    Now I want to ask: can I use several popups in that code? I am not sure, that it’s a good idea to duplicate all this code several times for different popups.

    All of my popups have the same css selector for a button. And I’d like them all to have the same cookie settings.

    Can I list all the #popmake ID’s in one js-code somehow?

    Bel

    (@belimperial)

    Hi @giorgos93

    There is no need to repeat the same code. You can add the popup CSS class on the same code. Kindly ensure to add the .pum-close, .popmake-close on the code before your custom class for the close tag div.

    Here’s an example:

    function my_custom_popup_scripts() { ?>
    
        <script type="text/javascript">
    
            (function ($, document, undefined) {
                $('.pum-close, .popmake-close, .your-custom-class ').click(function (e) {
                    $('#popmake-927, #popmake-929').trigger('pumSetCookie');
                });
            }(jQuery, document))
    
        </script><?php
    
    }

    Here’s a sample settings, and result:
    https://share.getcloudapp.com/WnuZ7nr9

    Let us know if you have any questions.

    Bel

    (@belimperial)

    Hi @giorgos93

    I’m going to mark this as resolved, as we haven’t heard from you in a while.

    Feel free to create a new thread if you have any other questions.

    Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Different cookies expiration time’ is closed to new replies.