Google Analytics – Reporting a custom value

I have a vue website, using vue-gtag but a general answer can help and I will set the settings accordingly to vue-gtag.

I want to report how many items the user sees anytime he opens up a specific page, and then report in Data Studio a chart of the number of times 0,1,2….. items were displayed. For example, 0 items – 15 times, 1 item – 5 times, 2 items – 0 times and so on….

I have set a custom dimension, also in the Admin console but how can I get the values? when the page loads I report an event with the custom dimension and the total items but I might be missing something.