Skip to content

Commit 2cdd8ab

Browse files
committed
Add Common Room script
1 parent fc19a26 commit 2cdd8ab

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

docusaurus.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ const config = {
6262
'/js/visitoranalytics.js',
6363
async: true,
6464
},
65+
{
66+
src:
67+
'/js/commonroom.js',
68+
async: true,
69+
},
6570
],
6671

6772
themeConfig:

static/js/commonroom.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
(function() {
2+
if (typeof window === 'undefined') return;
3+
if (typeof window.signals !== 'undefined') return;
4+
var script = document.createElement('script');
5+
script.src = 'https://cdn.cr-relay.com/v1/site/ecfd6f4a-ae37-43b1-b11b-2a92f09f3089/signals.js';
6+
script.async = true;
7+
window.signals = Object.assign(
8+
[],
9+
['page', 'identify', 'form'].reduce(function (acc, method){
10+
acc[method] = function () {
11+
signals.push([method, arguments]);
12+
return signals;
13+
};
14+
return acc;
15+
}, {})
16+
);
17+
document.head.appendChild(script);
18+
})();

0 commit comments

Comments
 (0)