Tracking User Page Visits
ATTENTION: THIS IS OUR OLD SITE. TO SEE OUR NEW WEBSITE, CLICK HERE.
It is often useful to know and record which users are visiting which pages and when on your website. This code example shows you how to record and track your users page visits for later analysis, as is done for WixCodeBank.
The first step is to create a collection to store the page view history, similar to the screenshot below. Add the fields which are important for you to keep a history of. The created date field is automatically recorded and does not need to be added explicitly. The collection needs to allow anyone to update and add to it. This example creates a collection called ViewHist for saving historical page view information.
Please login or sign-up (it's free!) to view our code. Refresh the page if already logged in.
Disclaimer: To the best of our knowledge, this code works for its stipulated purpose. If you find an error in our code, or know of a better way to achieve the same result - please contact us! We will help where we can, however please be aware that the code is provided 'as is' and without a promise of support in using or implementing it.