Skip to content

Commit

Permalink
Include Google Analytics script (#4)
Browse files Browse the repository at this point in the history
readthedocs includes this itself, but for GitHub pages it needs to be
added.
  • Loading branch information
rossmotley authored May 31, 2024
1 parent 3f64dfe commit 908fa15
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions docs/source/_static/js/init.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
// Add cookieyes script
var script = document.createElement("script");
script.id = "cookieyes";
script.src = "https://cdn-cookieyes.com/client_data/58bb4c6a9878d62a6e5f8065/script.js";
document.head.appendChild(script);
(function () {
var script = document.createElement("script");
script.id = "cookieyes";
script.src = "https://cdn-cookieyes.com/client_data/58bb4c6a9878d62a6e5f8065/script.js";
document.head.appendChild(script);
})()

// Google tag (gtag.js)
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-KSFS200Z8J');

// Track scrolling to h2 sections by id
(function () {
var script = document.createElement("script");
script.src = "https://www.googletagmanager.com/gtag/js?id=G-KSFS200Z8J";
script.async = true;
document.head.appendChild(script);

// Track scrolling to h2 sections by id
var sentIds = [];

const observerCallback = (entries, observer, h2) => {
Expand Down

0 comments on commit 908fa15

Please sign in to comment.