Closed cballenar closed 5 months ago
@lindseydiloreto I'd be happy to get your thoughts on this or help with further changes to bring it more in line with the product if needed.
This is a great idea, thanks for submitting it! I'll take a look and merge everything shortly. 👍
Problem
When working with a page that alternates content and ads, caching the content in the page leads to the ads being rendered once. Since the counting of the views occurs at rendering, views of the cached content are not counted.
Solution
Details of PR
AW_TRACK_VIA_JS
. It'd be great to have this more easily accessible. If this is set tofalse
, the current behavior of AdWizard is used; otherwise it disables view tracking on render and adds anonload
attribute to the ad configuration that will trigger the view tracking.actionView
controller was added accepting an ID and returning the equivalent response asactionClick
view
method is added to the js to send view requests to the controller. This method allows passing a boolean to define if ad views are trackedoncePerPage
. This started as a way to prevent accidental double tracking of views in a single page but can also be used the other way around (say if an ad enters the viewport multiple times?). It is configured to track once by default.