Listing View Count on SPA-- Need to show metrics to advertisers

I have developed an SPA that features a business directory.

When the user clicks a business from the repeating group (list of businesses), the data for that business is displayed in a group, using conditionals and dynamic data.

I would like to be able to count the number of times an individual business’ “listing” is shown-- since they aren’t separate pages, I would need to count the number of times the data is called from the database.
This is to help show the clients how much exposure their listing is getting.

Does anyone know how to do this?
Any help is greatly appreciated, thank you!!

1 Like

Since nobody has answered this, I’ll tell you what I would do…

I’d create a custom state, maybe something like ‘view count’ and set it initially to 0. Then do a workflow that would +1 for each view.

Then create a database of ‘business views’. Business, linked to business and views (number).

Run an API for hourly or whatever…maybe daily?

Have a separate page for view counts for each business.

Have never did this…just my thoughts.

Thank you so much!
I ended up figuring this out:
I added the field “Views” on the Business Profile in the database.
I already use custom states to navigate between groups, so I attached an extra step to the workflow on the clickable items that navigate the user from the list/directory of businesses (in a repeating group) to the business listing.
I added the last step as you indicated:


Every time the button is clicked, it adds one to the total view count.

I display the view counts in my Admin dashboard on a separate page.

Hearing from you confirmed I did this in the most logical way, so I really appreciate your response!