mirror of
https://github.com/ryanoasis/nerd-fonts.git
synced 2024-09-19 09:51:48 +02:00
Adds tracking for glyph searches
This commit is contained in:
parent
9adee0c8d8
commit
95c6b4d9f3
2 changed files with 14 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
{% if site.google_analytics_key %}
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics_key }}"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var _gaq = _gaq || [];
|
||||
|
@ -11,5 +12,10 @@
|
|||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||
})();
|
||||
|
||||
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
gtag('config', '{{ site.google_analytics_key }}');
|
||||
</script>
|
||||
{% endif %}
|
9
site.js
9
site.js
|
@ -115,7 +115,14 @@ $(document).ready(function (){
|
|||
|
||||
// extremely basic search
|
||||
|
||||
$('#glyphSearch').on('keyup', searchGlyphs);
|
||||
$('#glyphSearch').on('keyup', function(e) {
|
||||
gtag('event', 'glyph-search', {
|
||||
'event_category': 'via-input',
|
||||
'event_label': 'Cheat Sheet',
|
||||
'value': e.target && e.target.value
|
||||
});
|
||||
searchGlyphs();
|
||||
});
|
||||
|
||||
function searchGlyphs() {
|
||||
console.log('searching');
|
||||
|
|
Loading…
Reference in a new issue