Have you tried to use special event handler for this? There you are able to use special Event Context object which is contain additional info. And then with the Data API you can save info in the table.