• Resolved BackpackersUnion

    (@backpackersunion)


    Hello,

    I’m having trouble figuring out if “Popup Maker” has the control features needed to make a “Getting Started” message popup for BuddyPress.

    The triggers or behaviors I’m looking to incorporate are:

    1. Popup opens when user first logs into their account.
    2. Popup has “Permanently dismiss” check box or option.
    3. Popup has a “Regular close X” that closes the popup until the next session only (Until user logs back in again).

    From reading the Popup Maker documentation, it seems #1 and #3 are possible, but I am unsure about #2? I read that cookies are one way to prevent the popup window from triggering, but doesn’t seem like the best long term solution.

    Any ideas on how this could work?

    Thanks for the great plugin!
    -Carl

    WordPress/BuddyPress: Current Versions. Theme – 2014. Popup Maker – Works Great.

Viewing 10 replies - 1 through 10 (of 10 total)
  • @backpackersunion

    So on question two, how long would the dismiss be enabled for a popup for a month or longer?

    http://docs.wppopupmaker.com/article/148-cookies

    Thread Starter BackpackersUnion

    (@backpackersunion)

    Hi @lukecavanagh

    For #2, I’m looking for the ‘dismiss’ to last forever (i.e. the life of the users account). So, the dismiss could be years.

    The idea is to create a “Welcome / Getting Started” popup message. Once the user reads and ‘permanently dismisses’ the message, the user shouldn’t see the message again.

    Any ideas on how this might work?

    Thanks Luke!

    @backpackersunion @lukecavanagh

    To solve problems #2 and #3, you’ll first want to create two cookies with two different cookie names.

    For the first normal cookie (close button), make sure the Cookie Creation Event is set to On Popup Close and set it to “Session Cookie”.

    For the “Never See Again” cookie, use the Create a Close Button Using the Shortcode Button Feature to create a close button inside your popup. Make sure to give this close button a special CSS Class Name that is unique to this button (needed for later).

    Now create another cookie using the Custom Javascript Feature. Give a time value of something like “10 years” or whatever you see fit.

    Make sure both cookies are attached to your Auto Open Trigger – the trigger should have 2 cookies attached to it.

    Lastly, we’re going to make sure that when the user clicks the “Never See Again” button, that the button will trigger the 10 year cookie by using the following code (add this to your functions.php):

    <?php
    add_action( 'wp_footer', 'my_custom_popup_scripts', 500 );
    function my_custom_popup_scripts() { ?>
    <script type="text/javascript">
    	(function ($, document, undefined) {
    		$('css-selector-for-the-close-button').click(function (e) { $('#popmake-166').trigger('pumSetCookie'); });
    	}(jQuery, document))
    </script><?php
    }

    Make sure to change the Popup ID # above to the appropriate ID # for your popup.

    That should do the trick! Let us know if it works or if you have any other questions.

    • This reply was modified 7 years, 9 months ago by waltmesser.
    • This reply was modified 7 years, 9 months ago by waltmesser.
    • This reply was modified 7 years, 9 months ago by waltmesser.

    In the code above, you most likely won’t have to include the <?php because it will probably already be at the top of the file – just double check for that.

    Thread Starter BackpackersUnion

    (@backpackersunion)

    Hi @waltmesser

    Thanks for the detailed response!

    For #2, the permanent close button, I wasn’t able to get it working.

    The CSS Class I created for the close button is: permclose
    Cookie Name: pum-598

    So, the code I added to my child theme function.php looks like:

    add_action( 'wp_footer', 'my_custom_popup_scripts', 500 );
    function my_custom_popup_scripts() { ?>
    <script type="text/javascript">
    	(function ($, document, undefined) {
    		$('permclose').click(function (e) { $('#popmake-598').trigger('pumSetCookie'); });
    	}(jQuery, document))
    </script><?php
    }

    *I also tried ‘pum-598’ in place of ‘#popmake-598’, with no luck.

    Settings:
    Manual JavaScript Settings: name= pum-598, Use Session Cookie= No, Cookie Time= 20 years, Site Wide Cookie= Yes.

    Button Short Code= [popup_close tag="span" classes="permclose"]No Thanks[/popup_close]

    Trigger= Auto Open, Cookies= pum-599, pum-598, Delay= 0

    When “No Thanks”, the permanent button is pushed, it’s behaving like a Session cookie, so closing the browsers and logging back in reopens the popup.

    Are there any other combinations I could test?

    Also, is the Manual JavaScript Cookie unique to the BuddyPress User (So, logging in on a different computer won’t trigger the popup once the permanent close has been pushed on another device?) or is the cookie device/browser specific?

    Thanks again for your help on this! Let me know if any addition information is needed.

    Carl

    PS: I just noticed a second <?php at the very end as well as a ?>. I’m not sure if they were intentionally added so I tried removing them with no luck (White screen of Death). The function.php does already have the <?php , ?> Thanks again!

    Thread Starter BackpackersUnion

    (@backpackersunion)

    Just an idea:

    Would it be possible to hook into some action that occurs at account activation (to open the popup)? I figure there must be some condition that could trigger the popup window when a new user first logs into their account using something like bp_core_activated_user (Guessing)?

    If a condition could be set that only happens when a user first registers, then setting a cookie to prevent it from opening again could be avoided.

    I’m speculating quite a bit, but let me know if there is anything that could be tested. Thanks!

    @backpackersunion

    The code you inserted looks good except your class within the single quotes should include the “.” which represents a CSS “class”. It should look like '.permclose'.

    Also, Advanced Targeting Conditions could work as well – check out the sales page here or you can learn about all the features and settings, which includes a few options that should work in your situation.

    Having said all that, I’m going to have the Lead Dev @danieliser take a look in this thread to give you a definitive answer.

    Thread Starter BackpackersUnion

    (@backpackersunion)

    Hi @waltmesser and @danieliser

    Thanks for your response!

    I did test the CSS class with a period (i.e. ‘.permclose’), but didn’t have any luck. This 20 year cookie is behaving like a Session Cookie that resets when the browers is closed (‘Use session cookie?’ NOT checked in options).

    I did look at the advanced targeting controls, but aside from finding something that Popup Maker can target during account activation (Some unique Query String, A Referrer URL unique to activation?) I’m unsure how to trigger the popup early then prevent it from opening again once the user permanently dismiss it.

    I suspect the solution may require writing something to the database that indicates the popup has been permanently dismissed on a per user basis (Outside my expertise).

    I know this isn’t currently a feature of popup maker, but does it sound possible? There are no other popup plugins that do this, and because most BuddyPress users have registered accounts, it would make popup maker incredibly flexible.

    Thanks again!
    Carl

    Plugin Author Daniel Iser

    (@danieliser)

    @backpackersunion – You are correct, if you don’t want to rely on cookies, then your only option would be to either to use AJAX or a page refresh when they click the never show again option to set some user_meta option to true. Then use that as a condition for your popup. IE that user_meta doesn’t exist.

    There is nothing like that built in sorry. But it wouldn’t be hard for you to create yourself either.

    Hope that helps.

    Closing this ticket due to inactivity. If you’re still having an issue, create a new thread, link this one, and we will continue troubleshooting.

    Please take a moment to rate and review our plugin and/or support.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘“Permanently Dismiss” check box or option?’ is closed to new replies.