Here is one concept that will work so that the impression is legit e.g. actually visible on the users viewport (display) and there are no duplicates e.g. page refresh keeps +1 value to the impressions count (without the use of tracking the users IP address, though that would be more accurate).
Anyhow, here is a simple principle, it can be improved and I’m not sure of the performance indication, depends on your user basis and other page workflows to take into account:
Go to your plugins and install ‘On Screen Detector’
In my example, I’ve used a data type called ‘Photos’, but within your data type, created a new field as a type ‘User’ and set to a List.
Now on the repeating group, add the new element ‘On Screen Detector’, you can add it into the actual cell group so its nested, as long as it can refer to the ‘Parents group…’.
I’ve left the element properties to their defaults, should be fine, but you may want to tinker with these to find the best trigger (depends on screen sizes and repeating group style):
Next create a new workflow event ‘A On Screen Detector Enters Screen’
Then add a condition, something like the below onto the main workflow event just created:
It just stops impressions for the actual creator of the data type entry from being logged.
Now on the workflow action we make a change to a thing (we can work within the repeating group item, single basis):
Thats it. You can debug and check by adding some text into the repeating group to check that the count works for each entry:
So this is doing a count of the list of users logged in the field of the data type. There maybe a quicker way to get the data, but I assume you’ll be creating a dashboard or something similar for users to see the stats and what not.
You’ll notice that if a user isn’t actually logged in, it will be added, but it will appear blank as Bubble doesn’t have any data for that user since they don’t have an account, but it will still create a empty object. If a user is logged in, you’ll see the default primary field e.g. email assigned to the user who made the impression/view of the repeating group item.
So the result is that as a new user scrolls down the page, the workflow will run in the background as each repeating group cell is visible. This will track the unique (almost) impressions of the entry. You can do different tests logging in with unique users in your app or running Chrome in incognito mode and testing there.
Quick look into the preview and editor if needed for reference: