I have a Ruby on Rails project with a bootstrap theme. The top of the index page has a carousel which rotates a set of images on screen. I need to be able to count how many times an image appears onscreen. This will be used to determine how many people are seeing particular advertisements. Is there a way to do this?
I am pretty new to Rails so I'm not sure what its capabilities are. I was thinking that one way to do it is to have the JavaScript which runs the Carousel image switching trigger an event on the server so Rails can increment a counter.
I have also been looking into https://github.com/charlotte-ruby/impressionist but I am not sure how to trigger the impression counter.
Does anyone know how I can count how many times an images appears on screen? Thanks