• Resolved sharongraylac

    (@sharongraylac)


    Finally starting to get the hang of basic cookies… Now I’d like to take it a step further.

    Is is possible to prevent an Exit Intent popup from being triggered if a user has already subscribed through a different manual popup? Or is that crazy?

    Thanks a bunch!

Viewing 14 replies - 1 through 14 (of 14 total)
  • @sharongraylac

    Yes, you can do that. You just have to attach the appropriate cookie from your manual popup to the Exit Intent popup. So, if they complete the manual popup and fire the cookie off, the Exit Intent will also fire off, and won’t appear if the manual popup is completed.

    Hope that helps!

    Thread Starter sharongraylac

    (@sharongraylac)

    Thanks for getting back to me, @waltmesser!

    So just to make sure I understand correctly, I would have to create cookie for my click-triggered popup to not display after they subscribe, and then apply that same cookie to the exit intent opt-in?

    If so, I almost like that idea. I’m just worried about folks clicking a button and nothing happening. If they forgot they already signed up for my list, it just looks like I’ve got a faulty button.

    Is there a way to create a manual js cookie within the exit intent popup itself that prevents it from popping up if the Gravity Form from the OTHER popup is completed?

    For instance, is it possible to use the following filter, replacing the gform ID from the Exit Intent popup with the gform ID of the click-triggered popup?

    //Prevent popup from showing after form is submitted

    add_action( ‘gform_after_submission_[Exit Intent ID]’, ‘pum_gform_set_cookie’, 10, 2 );
    function pum_gform_set_cookie( $entry, $form ) {
    $date_of_expiry = time() + 60 * 60 * 24 * 365 * 10 ; // Calculates 10 years.
    setcookie( “[Exit intent cookie name]”, true, $date_of_expiry );
    }

    Fingers crossed… ??

    Thanks again!
    Sharon

    @sharongraylac

    So just to make sure I understand correctly, I would have to create cookie for my click-triggered popup to not display after they subscribe, and then apply that same cookie to the exit intent opt-in?

    This is correct.

    If so, I almost like that idea. I’m just worried about folks clicking a button and nothing happening. If they forgot they already signed up for my list, it just looks like I’ve got a faulty button.

    It should still work because even though you created a cookie for that popup, you didn’t attach it to the popup, you instead attached it to the Exit Intent popup. For a cookie to affect a popup, it still has to be attached to the popup. Creating a cookie =/= attaching a cookie.

    Having said that, you shouldn’t have to go through all the other stuff you posted.

    Let us know if that helps.

    Thread Starter sharongraylac

    (@sharongraylac)

    Oooooooh, this is BRILLIANT. Now If I can just make it work. lol

    So if I’m hearing you correctly, I just create a cookie for the click-triggered popup, however, I do NOT attach it to the click-triggered popup. Instead, I attach it to the Exit Intent popup.

    To do that, it looks like I would need to add that same cookie to exit intent popup as well, otherwise, it won’t let me attach it.

    Am I with you so far?

    And if it’s a 10 year cookie, I’m assuming this needs to be another manual js cookie. Yes?

    Which means I need to add another function specific to that cookie?

    Any idea where I’m going wrong?

    Thanks a bunch!
    Sharon

    @sharongraylac

    That sounds right, is it not working?

    Thread Starter sharongraylac

    (@sharongraylac)

    Nope. Still not working.

    Here’s the action I’m currently using for my Exit Intent popup (which seems to be working well):

    //Prevent exit intent popup from showing after form is submitted

    add_action( ‘gform_after_submission_16’, ‘pum_gform_set_cookie’, 10, 2 );
    function pum_gform_set_cookie( $entry, $form ) {
    $date_of_expiry = time() + 60 * 60 * 24 * 365 * 10 ; // Calculates 10 years.
    setcookie( “pum-7408-subscribe”, true, $date_of_expiry );
    }

    I tried making a separate action for the new cookie, but that kept breaking my site. So then I changed the bottom line of the original action to:

    setcookie( “pum-7408-subscribe”, “pum-7332-click-triggered-subscribe”, true, $date_of_expiry );

    This no longer breaks my site, but it doesn’t seem to do anything.

    I even consolidated my Gravity Forms so they were both using the same form, but nadda.

    I also tried deleting the click-triggered-subscribe cookie from the Exit Intent popup, and only included it in the action (just for the heck of it), and nothin’.

    Any idea what I might be doing wrong?

    Thanks again,
    Sharon

    Thread Starter sharongraylac

    (@sharongraylac)

    Here’s where I’m getting tripped up (in hopes of making this easier)…

    Do I need to create a “Manual” js cookie for the click triggered popup?

    If so, what do I need to do differently to make the following action work (as it’s currently breaking my site)?

    add_action( ‘gform_after_submission_16’, ‘pum_gform_set_cookie’, 10, 2);
    function pum_gform_set_cookie( $entry, $form ) {
    $date_of_expiry = time() + 60 * 60 * 24 * 365 * 10 ; // Calculates 10 years.
    setcookie( “pum-7332-click-triggered-subscribe”, true, $date_of_expiry );
    }

    Is it breaking because there is already this action in effect?

    add_action( ‘gform_after_submission_16’, ‘pum_gform_set_cookie’, 10, 2 );
    function pum_gform_set_cookie( $entry, $form ) {
    $date_of_expiry = time() + 60 * 60 * 24 * 365 * 10 ; // Calculates 10 years.
    setcookie( “pum-7408-subscribe”, true, $date_of_expiry );
    }

    Thanks a bunch!
    Sharon

    • This reply was modified 7 years, 10 months ago by sharongraylac.
    • This reply was modified 7 years, 10 months ago by sharongraylac.

    @sharongraylac

    If you want to set a cookie using the Manual Javascript Event on a Gravity Form submission, you should be doing it this way.

    Any time you need to set a cookie for a form submission, unless you’re using Ninja Forms, then you’ll have to do it manually using the above linked method according to your form builder.

    Let us know if that helps.

    Thread Starter sharongraylac

    (@sharongraylac)

    So should I remove this code I received from Daniel and do it this way instead?

    And this will make it easier to make the cookie for one popup trigger the cookie for another?

    Thanks!
    Sharon

    Thread Starter sharongraylac

    (@sharongraylac)

    Actually, it’s half working, but not in a good way.

    Now when you click on the button that opens the click-triggered popup, it shows a black screen with no popup–which is exactly what I wanted to avoid.

    And the cookie isn’t stopping the exit intent popup from triggering. So now I’ve got a darkened screen and when I try to leave the page, it triggers the exit intent UNDER the overlay.

    I kinda feel like I’m taking crazy pills here. It seems like there’s something simple I’m missing, but I can’t seem to find that missing piece to make it all work.

    Thanks for hanging with me, either way.

    Sharon

    • This reply was modified 7 years, 10 months ago by sharongraylac.
    Thread Starter sharongraylac

    (@sharongraylac)

    So I may have ALMOST figured out a way to make it work, but it doesn’t feel stable to me.

    I added back the action for the exit intent popup (which has always worked well), and I then I added the js for the click-triggered cookie (since I can’t seem to figure out how to add another action without breaking my site).

    Now when I subscribe via the click triggered popup, the exit intent popup is no longer engaging. Hooray for that! BUT, it’s still preventing the click-triggered popup from popping up.

    I want that to ALWAYS show if someone clicks it, regardless of whether or not they’ve ever subscribed. I just don’t want the exit intent to engage if someone has already subscribed.

    Does this make sense?

    @sharongraylac

    And you don’t have any cookies attached to the Click Open Popup?

    Thread Starter sharongraylac

    (@sharongraylac)

    Yes, I created a cookie for the Click Open Popup. From the instructions above (see 2nd post from from you), I thought I was suppose to create one. Is this true? Or did I misunderstand something?

    @sharongraylac

    Can you screenshot your Trigger and Cookie Panes together in the admin so I may look at how you have it setup? Would you mind doing this for both Click Trigger and Exit Intent Popups?

    Also, let’s move this conversion to our Support Portal. Submit a new ticket there and link this thread in reference.

    Per WP Guidelines, we’re not supposed to support paid products here, and Exit Intent is a paid product. Sorry for the delay in getting this transferred! Marking resolved.

    Thank you!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Preventing Exit Intent if user subscribes via manual popup’ is closed to new replies.