Skip to content

Commit

Permalink
feat: add marketo analytics to documentation website (#281)
Browse files Browse the repository at this point in the history
* feat: add marketo analytics to documentation website
  • Loading branch information
Vladimir Berezovsky authored Jun 16, 2020
1 parent fb45d94 commit 05c1b57
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
8 changes: 7 additions & 1 deletion website/siteConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,13 @@ const siteConfig = {
},

// Add custom scripts here that would be placed in <script> tags.
scripts: ["https://buttons.github.io/buttons.js"],
scripts: [
"https://buttons.github.io/buttons.js",
{
src: "js/marketo.js",
defer: true
}
],

// On page navigation for the current documentation page.
onPageNav: "separate",
Expand Down
21 changes: 21 additions & 0 deletions website/static/js/marketo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* eslint-disable no-undef */
(function() {
var didInit = false;
function initMunchkin() {
if (didInit === false) {
didInit = true;
Munchkin.init("418-ESG-906");
}
}
var s = document.createElement("script");
s.type = "text/javascript";
s.async = true;
s.src = "//munchkin.marketo.net/munchkin.js";
s.onreadystatechange = function() {
if (this.readyState === "complete" || this.readyState === "loaded") {
initMunchkin();
}
};
s.onload = initMunchkin;
document.getElementsByTagName("head")[0].appendChild(s);
})();

0 comments on commit 05c1b57

Please sign in to comment.