digital-analytics-program / gov-wide-code

Provides a set of javascript files and documentation to implement web analytics on US federal websites
http://www.digital.gov/dap
104 stars 55 forks source link

track page-level yes/no events #120

Open ryanwoldatwork opened 3 months ago

ryanwoldatwork commented 3 months ago

User story

As a web manager I want to track page level sentiment (Was this page helpful?) So that I can fulfill the intent of the M-23-22 and so that I can interpret the signals to make decisions about how page-level performance

Acceptance

Given a page exists with DAP on it, And the page has some TBD yes/no markup on it with 2 DOM elements (thumbs up / down) When a user clicks the Yes element, or No element Then I can see events in DAP

Implementation ideas

This might look like a couple conditional event listeners and elements like .positive-page-indicator (yes button) and .negative-page-indicator (no button). These events would emit events to DAP, like https://github.com/GSA/touchpoints/wiki/Analytics-Events.