-
Notifications
You must be signed in to change notification settings - Fork 945
Closed
Labels
Milestone
Description
Universal Analytics (UA) is deprecated. For details, see #1096. Here's some of the code associated with the page feedback feature:
docsy/layouts/partials/feedback.html
Lines 37 to 53 in d9bf98b
const sendFeedback = (value) => { | |
if (typeof ga !== 'function') return; | |
const args = { | |
command: 'send', | |
hitType: 'event', | |
category: 'Helpful', | |
action: 'click', | |
label: window.location.pathname, | |
value: value | |
}; | |
ga(args.command, args.hitType, args.category, args.action, args.label, args.value); | |
}; | |
yesButton.addEventListener('click', () => { | |
yesResponse.classList.add('feedback--response__visible'); | |
disableButtons(); | |
sendFeedback(1); | |
}); |
This still uses the analytics.js
library's ga()
function. Note that this code is incompatible with GA4 because of the library that is used and the event name, as is explained below.
Tasks
- Migrate from analytics.js to gtag.js - Use the gtag.js analytics library by default #1177
- Enable page feedback even without a Google analytics ID #1727
- Fix event emitting code that calls
gtag
- [GA4] Emitpage_helpful
events for page feedback #1726- Confirm that
page_helpful
events are being emitted, with a default value of 100 for "yes" and 0 for "no" responses:- For docsy.dev
- For example.docsy.dev
- Confirm that
- Add entry to the CHANGELOG
- Update the docs, Access the feedback data in particular - [GA4] Emit
page_helpful
events for page feedback #1726 - Add a comment to "Helpful" event not registering in GA4 #1426
Notes:
- Interestingly, Kubernetes docs had switched to using
gtag.js
in their override of layouts/partials/feedback.html already 4 years ago - Indirectly related:
jmichelgarcia and arthurkjmichelgarcia and huanlin