1

I am trying to use Microsft-Clarity https://clarity.microsoft.com/ in my Electron App. I have added their integration steps in Head section of my app's main page. On running the app, in network section it is shoiwng network call to https://d/clarity.ms/collect but it is giving 400 bad request error in the response.

I am using Electron version 13.x

Is it possible to use Clarity in Electron app or not? Or do I need to make any specific changes to support it?

I have added the following code in head section of page

<script type="text/javascript">
    (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", "<Project_id>");
</script>

POST request is being made for the following URL:

https://d/clarity.ms/collect

Request header has following value

authority: d.clarity.ms
method: POST
path: /collect
scheme: https
accept: application/x-clarity-gzip
accept-encoding: gzip, deflate, br
accept-language: en-US
content-length: 285595
cookie: MUID=XXXXXXXXXXXXXXXXXXXXX
sec-fetch-dest: empty
sec-fetch-mode: cors
sec-fetch-site: cross-site
user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) XXXXXX/XXXXX Chrome/91.0.4472.164 Electron/13.6.9 Safari/537.36

Getting the following response for the request

{  
     "type":"https://tools.ietf.org/html/rfc7231#section-6.5.1",
     "title":"Bad Request",
     "status":400,
     "traceId":"00-xxxxxxxxxxxxxxx-xxxxxxxxxxxx-00"
}
Shubham Agrawal
  • 161
  • 1
  • 1
  • 6
  • 1
    Please [edit] your question and provide enough code and detail so the problem could be reproduced. Also, it may be worthwile to include the requests as well as responses (with possibly sensitive data redacted, of course). – Alexander Leithner Nov 02 '22 at 15:20
  • You can use it ofc, as far as the electron allow the heart beat and such. – Benyamin Limanto Nov 03 '22 at 06:56

0 Answers0