Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //assuming jQuery is available
- //attach events to the nav buttons above datasets
- $('#sidebarOptions').on('click', 'a', function() {
- var dataset = $('#datasetName').attr('title');
- var label = $(this).attr('title');
- //labels sent to google analytics on click events will include the dataset name and the label of the button
- //this gives greater insight into how users are interacting with datasets once they arrive
- ga('send', 'event', 'Data Panel', 'Click', dataset + ': ' + label);
- });
- $('.downloadsList').on('click', 'a', function() {
- var dataset = $('#datasetName').attr('title');
- var label = $(this).attr('data-type');
- //labels sent to google analytics on click events will include the dataset name and the type of download file
- //this gives greater insight into how users are interacting with datasets once they arrive
- ga('send', 'event', 'Download', 'Click', dataset + ': ' + label);
- });
Add Comment
Please, Sign In to add comment