Last active
November 13, 2016 16:51
-
-
Save josephbriggsmrf/132b9f51cbc6866c13891db2c6080526 to your computer and use it in GitHub Desktop.
GA Reveal JS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var reveal = document.querySelector('.reveal'); | |
if (reveal) { | |
var title = document.querySelector('head title').innerText; | |
/* Send hit on slide change */ | |
Reveal.addEventListener('slidechanged', function () { | |
ga('send', 'event', 'Decks', title, 'Changed current Slide', Reveal.getIndices().h); | |
}); | |
/* Send hit on overview watch */ | |
/* Show Overview */ | |
Reveal.addEventListener('overviewshown', function () { | |
ga('send', 'event', 'Decks', 'overviewshown', 'Slide overview shown'); | |
}); | |
/* Hide Overview */ | |
Reveal.addEventListener('overviewhidden', function () { | |
ga('send', 'event', 'Decks', 'overviewhidden', 'Slide overview hidden'); | |
}); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment