IQSS/8263-Fix Google analytics button tracking #8274
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
The change in the reverted commit tried to make an element selector in the analytics-code.html file more precise. Unfortunately, the sub-element chosen only appears in some of the views that have the buttons that should be tracked, so the change stopped tracking of those buttons (the download menus in the file table - only the editFilesFragment tracking worked, tracking in the filesFragment broke with this change).
The only change in this PR is to revert the commit that made this change: Changed selector in analytics exmaple (sic) to be more precise [#6725], commit 1e5951f.
Which issue(s) this PR closes:
Closes #8263
Special notes for your reviewer:
Suggestions on how to test this: @kcondon discovered this via a null pointer error reported in the java console. With the updated anayltics-code.html configured, that error should be gone when a download button is clicked in the view mode for a dataset. One could also check Google for the actual button click event (which, if it doesn't appear might indicate other issues with analytics reporting).
Does this PR introduce a user interface change? If mockups are available, please link/include them here: no
Is there a release notes update needed for this change?: - The fact that Google analytics wasn't catching download button events for view mode - what you'd expect for published dataset versions - might be relevant, but I don't know that many people were using that (not actually sure, but there haven't been any (?) questions about it.)
Additional documentation: