scylladb / sphinx-scylladb-theme

The documentation toolchain for Scylla projects.
https://sphinx-theme.scylladb.com
Apache License 2.0
12 stars 12 forks source link

enable Heap for docs #1082

Open annastuchlik opened 5 months ago

annastuchlik commented 5 months ago

Request from @tzach:

Would be interesting to look at the Heatmap of the getting started HP.

How to enable (from @timkoopmans):

heap is not enabled for docs, but it can be added. Couple of different ways:

  1. update layout.html in sphinx_scylladb_theme and push to all repos that use the theme e.g.
git diff master..feat/add-heap-analytics
diff --git a/sphinx_scylladb_theme/layout.html b/sphinx_scylladb_theme/layout.html
index bad2e6e..f40c1d4 100644
--- a/sphinx_scylladb_theme/layout.html
+++ b/sphinx_scylladb_theme/layout.html
@@ -85,6 +85,13 @@
         <!-- Font Awesome -->
         <script src="https://kit.fontawesome.com/b1870adf6a.js" crossorigin="anonymous"></script>
         <!-- End Font Awesome -->
+
+        <!-- Heap Analytics -->
+        <script type="text/javascript">
+            window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src="https://cdn.heapanalytics.com/js/heap-"+e+".js";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(r,a);for(var n=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","resetIdentity","removeEventProperty","setEventProperties","track","unsetEventProperty"],o=0;o<p.length;o++)heap[p[o]]=n(p[o])};
+            heap.load("2144880022");
+        </script>
+        <!-- End Heap Analytics -->
     </head>
  1. Add the Heap snippet as a custom HTML tag and set it to fire on All Pages using Google Tag Manager:
dgarcia360 commented 5 months ago

@annastuchlik Option 2 seems more flexible to not have to distribute a new version of the theme

annastuchlik commented 5 months ago

Let's try to do that using Google Tag manager.

timkoopmans commented 3 weeks ago

Any updates on this one team?