• Resolved feroxy

    (@feroxy)


    Hi

    I’m using an action bar message and would like to have it work such that when the visitor clicks the close button, a cookie is set to keep the bar closed on subsequent page loads for a set time (say 15 mins) while the visitor browses. I would like the leave the CTA action unchanged by this.

    thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Icegram

    (@icegram)

    @feroxy,

    Thank you for writing in!
    You have to write some custom function for this in javascipt.
    You can track close event of Action bar and set cookie.
    First set delay time of action bar as -1 or if you have Behaviour Trigger then set “Show Trigger” as “Javascript Trigger”.
    jQuery( window ).on( “track.icegram”, function( e ,type, params ) {
    if(type !== undefined && type !== ” && type == ‘closed’ ){
    //set your cookies here
    }
    }
    And then check on other pages if that cookie is set and if it is not set fire show function of action bar :
    icegram.get_message_by_id({id}).show();

    You can add this code in custom js code block of Action bar.
    Try it and let us know how it goes?
    Thanks,
    Sandhya
    Team Icegram

    Thread Starter feroxy

    (@feroxy)

    got it working thanks!

    on a related note. Is there any way to programmatically determine the current icegram message id for the JS code? (similar to using #ig_this_message in the css)

    Plugin Author Icegram

    (@icegram)

    @feroxy,

    Thank you for update.
    Glad to here that it works for you.
    Currently it is not possible to detect current element in js but this is on our road map and we will soon include it in Icegram.
    BTW, I would be really grateful if you could drop us a 5 star rating about our product+service on this link.

    It’ll hardly take 2 minutes and will surely make our day ??

    Thank you in advance ??

    Have a great day ahead!

    Best wishes,

    ?Thanks,
    Sandhya
    Team Icegram

    This behaviour is exactly what I was looking for.
    I personnaly think that is a behavior you should impklement in the plugin.

    But still I find it very convenient that we can trigger the messages ourselves using jquery. I was not aware of that before reading this topic. Is it indicated in the documentation ?

    Thank you !

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘set cookie on action bar close’ is closed to new replies.