clarity.js 526 B

123456789101112131415161718
  1. export default ({ app }) => {
  2. // 在客户端加载 Clarity Analytics
  3. if (process.client) {
  4. (function (c, l, a, r, i, t, y) {
  5. c[a] =
  6. c[a] ||
  7. function () {
  8. (c[a].q = c[a].q || []).push(arguments);
  9. };
  10. t = l.createElement(r);
  11. t.async = 1;
  12. t.src = "https://www.clarity.ms/tag/" + i;
  13. y = l.getElementsByTagName(r)[0];
  14. y.parentNode.insertBefore(t, y);
  15. })(window, document, "clarity", "script", "ogbcy41zs4");
  16. }
  17. };