[PopUp Pro] Pop Up trigger to custom command

We have some different popups opening in different time intervals on our page and if the user clicks on the X icon (close icon) then we need to insert the User Id with the Popup id in our custom table. How can we achieve this bit.