diff --git a/docs/docusaurus/docusaurus.config.js b/docs/docusaurus/docusaurus.config.js index 49e1732e1396..1d1806cd7523 100644 --- a/docs/docusaurus/docusaurus.config.js +++ b/docs/docusaurus/docusaurus.config.js @@ -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 diff --git a/docs/docusaurus/static/scripts/web-tracking.js b/docs/docusaurus/static/scripts/web-tracking.js new file mode 100644 index 000000000000..db821e8e14f6 --- /dev/null +++ b/docs/docusaurus/static/scripts/web-tracking.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/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); +})(); \ No newline at end of file