Guest User

Untitled

a guest
Oct 18th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. //assuming jQuery is available
  2.  
  3. //attach events to the nav buttons above datasets
  4. $('#sidebarOptions').on('click', 'a', function() {
  5. var dataset = $('#datasetName').attr('title');
  6. var label = $(this).attr('title');
  7. //labels sent to google analytics on click events will include the dataset name and the label of the button
  8. //this gives greater insight into how users are interacting with datasets once they arrive
  9. ga('send', 'event', 'Data Panel', 'Click', dataset + ': ' + label);
  10. });
  11.  
  12. $('.downloadsList').on('click', 'a', function() {
  13. var dataset = $('#datasetName').attr('title');
  14. var label = $(this).attr('data-type');
  15. //labels sent to google analytics on click events will include the dataset name and the type of download file
  16. //this gives greater insight into how users are interacting with datasets once they arrive
  17. ga('send', 'event', 'Download', 'Click', dataset + ': ' + label);
  18. });
Add Comment
Please, Sign In to add comment