Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6938 analytics new buttons #7008

Merged
merged 7 commits into from
Jul 1, 2020
Merged

6938 analytics new buttons #7008

merged 7 commits into from
Jul 1, 2020

Conversation

mheppler
Copy link
Contributor

What this PR does / why we need it:

With the new button UI delivered in #6684, the analytics functionality was reviewed. This fixes some issues as a result of the new UI, as well as some bugs that were previously not reported. Updates to the sample code provided in the Installation Guide.

Which issue(s) this PR closes:

Closes #6938 Analytics - Event tracking code not capture all the btn clicks

Special notes for your reviewer:

These fixes should work for both 4.20 and 5.0 UI's.

Suggestions on how to test this:

Because this analytics code is used by installations that run 4.20, it should be tested on both the new 5.0 btn UI, as well as the previous 4.20 UI.

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

N/A

Is there a release notes update needed for this change?:

Yes, sysadmin who have < 4.20 installations should be notified they can update their existing analytics code to track click events that were being missed.

Additional documentation:

N/A

@mheppler mheppler requested a review from qqmyers June 22, 2020 19:25
@mheppler
Copy link
Contributor Author

Need to coordinate with @qqmyers and @djbrooke to confirm 4.20 fixes, and write appropriate release notes before getting this to QA.

@coveralls
Copy link

coveralls commented Jun 22, 2020

Coverage Status

Coverage remained the same at 19.557% when pulling dcb8100 on 6938-analytics-new-buttons into b97185a on develop.

@djbrooke djbrooke self-assigned this Jun 22, 2020
@djbrooke
Copy link
Contributor

@mheppler @qqmyers for the release notes, how do y'all want to handle it? I'm not sure I have enough info to write them from scratch but I can get on a call to discuss if it would be helpful

@djbrooke
Copy link
Contributor

@mheppler @qqmyers nm, just re-read. I can pull something together using the notes from 4.16 and 4.20 for your review. Moving back to dev for now.

Copy link
Member

@qqmyers qqmyers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I checked the selectors on v4.20 with the normal download, download with the dropdown choices for .tab files, and previewers, on dataset and file pages. The only note I have is that the 'category' reported to Google for the download for Tab files is the label for the specific option rather than the generic 'Download' - probably useful to have the added info (I mention this partly because when I tested I accidentally put a download category filter on and wondered where the events were.)

@mheppler mheppler self-assigned this Jun 23, 2020
@djbrooke djbrooke removed their assignment Jun 23, 2020
@djbrooke djbrooke added this to the Dataverse 5 milestone Jun 24, 2020
@mheppler
Copy link
Contributor Author

mheppler commented Jun 24, 2020

@kcondon wanted to outline some code clean up in my last commit here.

  • fix publish btn styling on datatset pg, round the squared off border on right side of btn
  • fix download btn-group accessibility, add aria-label="File Actions" text to bundle
  • remove jim's downloadFile script (use POST for file download to avoid url length limits #6957) out of file-download-button-fragment.xhtml, move under download-selected btn in dataTable header in filesFragment.xhtml, so the javascript only appears once in source code

That last bullet is the major piece. In the original PR to change large bulk downloads from GET's to POST's, the javascript snippet that was added to the file-download-button-fragment.xhtml resulted in the same javascript snippet being added multiple times to the source code for every file table row, while it only needs to be added to the page once. I moved that snippet to the table header code in filesFragment, so it is grouped under the Download button that requires it, and it only displays in the source code once. Also followed up with @qqmyers to confirm that the behavior I was seeing in my browser console was correct for a bulk download of 1,500 files. (See screenshot.)

Screen Shot 2020-06-24 at 2 29 18 PM

@mheppler
Copy link
Contributor Author

The only note I have is that the 'category' reported to Google for the download for Tab files is the label for the specific option rather than the generic 'Download' - probably useful to have the added info.

@qqmyers, after looking at my test Google Analytics dashboard, I am leaning towards useful. Previously the only download click events tracked for the single-click, non-tabular files, had "Download" for both Event Category and Event Action. Providing this additional information in the category still allows the "Download" totals to be filtered in reports under Event Action.

That said, I am happy to learn more about how these events and reports are used for your installations, and if there are further improvements that can be made. We are just starting to think about how we drill into them ourselves, as we've only collected a couple months of analytics from our installation.

@mheppler mheppler removed their assignment Jun 25, 2020
@kcondon kcondon self-assigned this Jul 1, 2020
@kcondon
Copy link
Contributor

kcondon commented Jul 1, 2020

@qqmyers gave a good tip for testing: check the comments in the analytics code for which to btns to check:

grep "//" analytics-code.html
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-61753334-3"></script>
  //<![CDATA[
    // Download button
    // Request Access button
    // Explore button
    // Compute button
    // Preview button
    // Cite button
    // Export Metadata button
    // Contact button
    // Share button
      //Special case - the Download button that downloads all selected files in the dataset
        //finds the file id/DOI in the Dataset page
        //finds the file id/DOI in the file page
  //]]>

@kcondon
Copy link
Contributor

kcondon commented Jul 1, 2020

@mheppler All of the above works except the share button, which is not yet hooked up.
Update: share is working too, just need to click on the individual icons in share popup.

@kcondon kcondon merged commit c29ce7f into develop Jul 1, 2020
@kcondon kcondon deleted the 6938-analytics-new-buttons branch July 1, 2020 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Analytics - Event tracking code not capture all the btn clicks
7 participants