diff --git a/about/faq.md b/about/faq.md index 164d6ac7f..fb9d7834d 100644 --- a/about/faq.md +++ b/about/faq.md @@ -18,7 +18,7 @@ menus: -
+
{% capture accordionContent %} If you’re new to GitHub and open source in general, figuring out how to get set up can be a challenge. You may want to read through the GitHub Help pages on [setting up and managing your GitHub profile](https://support.github.com/features/account). diff --git a/assets/js/hashes.js b/assets/js/hashes.js index cc6a4b3c8..c216e4346 100644 --- a/assets/js/hashes.js +++ b/assets/js/hashes.js @@ -10,9 +10,9 @@ window.addEventListener('load', function() { if (!element) { return; } - console.log(element); if (element.className.indexOf('accordion-collapse') > -1) { new bootstrap.Collapse(element, { show: true }); + recordAccordionOpen(element); } } @@ -22,6 +22,7 @@ window.addEventListener('load', function() { element.addEventListener('show.bs.collapse', function(event) { const hash = '#' + event.target.id; window.history.replaceState('', '', hash); + recordAccordionOpen(element); }); element.addEventListener('hide.bs.collapse', function(event) { @@ -33,4 +34,10 @@ window.addEventListener('load', function() { }); } + + function recordAccordionOpen(element) { + if (typeof _paq !== 'undefined') { + _paq.push(['trackEvent', 'Accordion', 'Opened', element.id]); + } + } }); \ No newline at end of file