diff --git a/docusaurus.config.js b/docusaurus.config.js index 13cf77f5..fffbd93f 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -121,6 +121,11 @@ module.exports = { src: "/js/segment.js", async: true, defer: true, + }, + { + src: "/js/commonroom.js", + async: true, + defer: true, } ], markdown: { diff --git a/static/js/commonroom.js b/static/js/commonroom.js new file mode 100644 index 00000000..3ac4865a --- /dev/null +++ b/static/js/commonroom.js @@ -0,0 +1,18 @@ +(function () { + if (typeof window === 'undefined') return; + if (typeof window.signals !== 'undefined') return; + var script = document.createElement('script'); + script.src = 'https://cdn.cr-relay.com/v1/site/b184a8a2-6ac1-4606-b0cb-a52a8b86395b/signals.js'; + script.async = true; + window.signals = Object.assign( + [], + ['page', 'identify', 'form'].reduce(function (acc, method) { + acc[method] = function () { + signals.push([method, arguments]); + return signals; + }; + return acc; + }, {}) + ); + document.head.appendChild(script); +})(); \ No newline at end of file