How to structure numbers of posts accessed by a user in a membership site?
I have a Custom Post Type named Deals in my site. On each Deal page, I have a button which only users having membership access can view it. On clicking this button, a random coupon code in generated and then the button is getting disabled for that user for that particular deal until he renews his membership.
In short, each deal can be accessed once by each user in a span of membership.
For this functionality, I’m saving the deal’s post ID in the user’s meta whenever the button is clicked, so once user clicks the button, the coupon code shows up and that post’s ID get’s saved in the user meta and hence the button is disabled.
Now I have to create an admin page where the admin can see monthly reports of all the deals accessed, so that page should show which deals were accessed by which user and on which date.
How do I achieve this functionality? Should I create a custom database table to save the userID, date on which he accessed the deal and the deal ID? Or should I create multiple meta fields for this and save this in user meta?
Thanks in advance !