• Hi!
    I want to perform some action once user select yes button on the age gate plug in page. I have added a new snippet in wordpress with following code which i took from the forums only but I am not getting any console message as stated in code.
    I create a new snipped with type – javascript, location as Header, site display as site wide. I am using latest javascript based plug in. Please help me to troubleshoot this issue.

    <script>
    (function($){
      $(document).on('agegatepassed', function () {
        console.log($('.age-gate-form').serializeArray());
      });
    })(jQuery);
    </script>
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Phil

    (@philsbury)

    Hi @amishah2007,

    Try binding the event to window instead of document and see if that works.

    Thanks
    Phil

    Thread Starter amishah2007

    (@amishah2007)

    @philsbury You are just great. Thanks a lot for your help.

    Thread Starter amishah2007

    (@amishah2007)

    @philsbury
    I just need another help. Age gate pop up is coming on the main home page and my home page takes some time to load so what end user see is like age gate is taking so much time to load even it is very simple page. Do you have any option like till the time user clicks on “Yes” button the home page will not get loaded.

    Right now what I have done to overcome this problem is, i created a blank page and name the url as a home page so my age gate will be shown on blank home page which will not take time to load. When user clicks on Yes, I capture event and redirect to main home page.
    Now the problem is due to caching or I am not sure, If I open URL in the second browser, age gate is not getting displayed so I am not getting event and the blank page is getting displayed.

    Will you please help me out.
    you can try out my solution at https://gethouseof2stg.wpengine.com/home-page-testing/

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Not Getting agegatepassed event’ is closed to new replies.