Skip to content

Commit a675748

Browse files
committed
Add click tracking as diff commit to this branch
1 parent 485aa42 commit a675748

File tree

1 file changed

+11
-0
lines changed
  • readthedocs/core/static-src/core/js/doc-embed

1 file changed

+11
-0
lines changed

readthedocs/core/static-src/core/js/doc-embed/sphinx.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ var rtd = require('./rtd-data');
88

99
function init() {
1010

11+
/// Click tracking on flyout
12+
$(document).on('click', "[data-toggle='rst-current-version']", function() {
13+
var flyout_state = $("[data-toggle='rst-versions']").hasClass('shift-up') ? 'was_open' : 'was_closed'
14+
if (_gaq) {
15+
_gaq.push(
16+
['rtfd._setAccount', 'UA-17997319-1'],
17+
['rtfd._trackEvent', 'Flyout', 'Click', flyout_state]
18+
);
19+
}
20+
});
21+
1122
/// Read the Docs Sphinx theme code
1223
if (!("builder" in rtd) || "builder" in rtd && rtd["builder"] != "mkdocs") {
1324
function toggleCurrent (elem) {

0 commit comments

Comments
 (0)