ℹ [Plugin] Closing Page Event - trigger backend by EzCode

Closing Page Event

Send data to the backend when a user leaves your website.

  • Will make an api call to your backend (even if the user closed the page without any popup)
  • Send any kind of data to backend.
    For example, the current user ID, so you could change the user’s status to offline.
  • Show a popup that will prevent closing the page and ask the user if he is sure that he wants to close it. (Optional)

Examples:
Change status in backend when closing page

backend_demo

Show popup to prevent closing

popup_demo


Demo: https://ezplugins-demo-1.bubbleapps.io/closing_page_event
Market: https://bubble.io/plugin/closing-page-event-1605269744249x423992413751607300


ez_logo EzCode.co
Feel free to contact us for any inquiries and we’ll be happy to find a solution for your ideas

4 Likes

We’ve made a video on how to setup an Endpoint in backend workflow to be used for this plugin.

Hey there!

This plugin is super cool and handy! I could see several use cases for this with our system.

I just wanted to let you know that I ran into an issue that I would at least have, and see what your idea of a workaround or maybe I’m not doing something right.

If a user has 2 or more tabs open, if just 1 close, is there a way to keep them online? I just tested the demo out with 2 tabs open, and then closed one, and noticed it went to Offline.

My thought process is you could merely have a session check into the user data type, and everytime a new “tab” is detected add 1, and if a close is fired up, then a minus 1, and from there trigger another workflow to mark offline if the count is 0. Would that be a decent solution?

Thanks!
Drake

1 Like

Hi, thank you!
Good observation on multiple opened tabs bug.
Will see what we can do with it. I will let you know when we will have a working solution.

Regards,
Andrew

Hi again! We have pushed an update to solve the issue with multiple tabs.
Working with LocalStorage, the plugin will detect if multiple tabs of the same page are opened and will trigger the backend only when the last one is closed.

1 Like

That is awesome! We will most certainly look into this more now!

2 Likes

Hello @ezdev . This plugin does not seem to be working on mobile. When I close a tab on safari on a phone it does not update the database

Make sure you are doing any interaction with the page.
There’s a warning on demo page about it.

1 Like

Hi there,

Would it be possible to enable the feature where a webhook is send for every closing of a browser? Not the earlier discussed ‘multiple tabs - only one webhook’ solution?

Also is it possible to stop the browser from closing and opening a popup? or would that be difficult?

Thanks!

Has anyone gotten this to work properly? I have done everything in the tutorial and the dev takes a week to respond to support emails (without even really ready my support email to begin with, by telling me things I had already tried). I have everything setup correctly but no data is pushing to my backend workflow, and yes, even after removing “initialize” from the trigger URL. Any help would be great.

@ezdev
Hello EazyCode, this plugin has lots of bugs and does not work as advertised on your demo page. In my frustration I have even gone as far as purchasing and installing a second time on a blank application to ensure something was not conflicting however my results have been the same.

Let me explain:

  1. this plugin when changing settings around will sometimes fool the user, “Inform Backend” checkbox can be selected however when viewing the plugin using debugger from the front end it states “Inform Backend: No”. This can be solved by turning the setting off, reloading page on front end, turn setting back on and reload front end again.

  2. I have had the webhook now multiple times quit working, sending a request via “detect data” will also stop working. The only solution I have found for this was to delete the elements, reinstall the plugin and setup again.

  3. The most frustrating of them all though is that in firefox and edge if a user has more than 1 tab open and closes the application page the webhoook sends out perfectly, however if a user only has 1 tab open (the second tab can be any webpage, not the application page) and either selects the “x” icon in top right or closes the single tab both of which will result in the browser being closed the webhook will not send out. This is despite the fact that it does appear to work on the demo page.

again let me reiterate that I have ensured it is not conflcting with any other part of the application as I have even tested on a brand new app. The workflow being triggered by the webhook is exactly the same as the demo, simply setting isOnline from yes to no. I can get it to work 100% on chrome and if more than 1 tab is open in firefox or edge it also works.

The demo page has caused me and I am sure alot of other users headache and wasted time, I see another user has also asked for help in the post above mine and has not received a response for 22 days. Any insight into whats happpening with this plugin would be great.

Hello @coty, Closing Page Event Plugin, was designed in the good old days when was no responsive engine, that’s why at this moment we have errors. Our Demo Page isn’t on new responsive engine and plugin works as it should. We are currently working on releasing an update for the plugin.

Why not put something in the description to explain this to users so that people dont waste time troubleshooting as I and I am sure many others did. @eazycode

hi @coty, mikev in email correspondence has solved his problem in this way “I just wanted to let you know that I got it working with some more trial and error. Turns out the only way I was able to get it working was to remove the “version-test” from the endpoint URL.”, can You try it?

Please is this plugin still functional?..My backend cant receive the response when i close page

http://forum.bubble.io/t/re-plugin-closing-page-event-trigger-backend-by-ezcode/271629

@aspajeolebouf28 - does it helps ?

Regards Pavel from EazyCode

Hey @eazycode - I’ve set everything up and it seems to work, however the plugin doesn’t seem to care whether I tell it not to show a popup on exit, it just does it every time anyway. Can you ship a fix for this?

Thanks

Hey @tmxl , thanks, currently this plugin is under @ZeroqodeSupport, will ping them for faster answer

Cheers

1 Like

Hi @tmxl,

Thank you for getting in touch, and I apologize for the delay in our response :pray:

We’ve tested the plugin on our end, and it appears to be functioning as expected. When the “show popup” field in the element is set to “no,” the popup doesn’t appear, and when it’s set to “yes,” the popup displays as intended.

To help us better assist you, could you please double-check your configuration to ensure it’s set up correctly? If the issue persists, it would be greatly appreciated if you could provide us with screenshots of how the element is configured and what determines the value for the “show popup” field.

Wishing you a fantastic Monday! :hugs:

1 Like