webwhiz-ai / webwhiz

WebWhiz allows you to create an AI chatbot that knows everything about your product and can instantly respond to your customer's queries.
https://www.webwhiz.ai/
GNU Affero General Public License v3.0
929 stars 158 forks source link

Make Pirsch analytics integration optional #222

Closed runephilosof-abtion closed 2 months ago

runephilosof-abtion commented 3 months ago

In order to build with a Pirsch key: docker compose build --build-arg PIRSCH_KEY="VEW6587Xat8LXjE7ejokwXUked6s7udc"

Parcel processes process.env.PIRSCH_KEY as a macro, so it will evaluate it at build time.

When supplying the PIRSCH_KEY, it generates the following index.html:

    <script>!function(){let t="VEW6587Xat8LXjE7ejokwXUked6s7udc";if(t){let e=document.createElement("script");e.setAttribute("src","https://api.pirsch.io/pirsch.js"),e.setAttribute("id","pirschjs"),e.setAttribute("defer",""),e.setAttribute("data-code",t)}}();</script><script>!function(){let t="VEW6587Xat8LXjE7ejokwXUked6s7udc";if(t){let e=document.createElement("script");e.setAttribute("src","https://api.pirsch.io/pirsch.js"),e.setAttribute("id","pirschjs"),e.setAttribute("defer",""),e.setAttribute("data-code",t)}}();</script>

Without supplying the PIRSCH_KEY, it generates:

    <script>!function(){let t=void 0;if(t){let e=document.createElement("script");e.setAttribute("src","https://api.pirsch.io/pirsch.js"),e.setAttribute("id","pirschjs"),e.setAttribute("defer",""),e.setAttribute("data-code",t)}}();</script>

Closes: https://github.com/webwhiz-ai/webwhiz/issues/220

hrithikt commented 2 months ago

@runephilosof-abtion we have removed pirsch analytics (0118c773d1d4e0526fd70138aecb103afd4278c3) completely from the widget.