Skip to content

Commit

Permalink
Adding commonroom web tracking snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
deborahniesz committed Dec 20, 2024
1 parent c534b64 commit 12747aa
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/docusaurus/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ module.exports = {
async: true,
defer: true,
},
{
src: '/scripts/web-tracking.js',
async: true
},
{
src: 'https://fast.wistia.net/assets/external/E-v1.js',
async: true
Expand Down
18 changes: 18 additions & 0 deletions docs/docusaurus/static/scripts/web-tracking.js
Original file line number Diff line number Diff line change
@@ -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/fa55f78e-0306-4363-88ae-e92ab04d95c6/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);
})();

0 comments on commit 12747aa

Please sign in to comment.