clarity icon indicating copy to clipboard operation
clarity copied to clipboard

How to manually set up clarity in vue js website?

Open sookyee opened this issue 3 years ago • 1 comments

Ive tried to copy the code in clarity directly and embed it into the head tag in my App.vue but it throws syntax errors and now I tried this in a script tage in app.vue but doesn't seem like its being tracked?

const script = document.createElement('script'); script.onload = () => { (function (c, l, a, r, i, t, y) { c[a] = c[a] || function () { (c[a].q = c[a].q || []).push(arguments) }; t = l.createElement(r); t.async = 1; t.src = "https://www.clarity.ms/tag/" + i; y = l.getElementsByTagName(r)[0]; y.parentNode.insertBefore(t, y); })(window, document, "clarity", "script", "cfkwz7s9tg"); }; document.head.appendChild(script);

sookyee avatar Jun 21 '22 04:06 sookyee

Is there a reason for why you cannot include the script in the <head> of index.html?

ondrej-vesely avatar Jun 30 '22 09:06 ondrej-vesely