live chat integration for tawk.to

This commit is contained in:
tim
2024-08-31 22:19:22 -04:00
parent 831a86beeb
commit bdad4c7257
3 changed files with 18 additions and 19 deletions

View File

@@ -1,8 +1,8 @@
<template>
<router-view/>
<HubSpot/>
<tawk-to/>
</template>
<script setup>
import HubSpot from "@/components/HubSpot.vue";
import TawkTo from "@/components/TawkTo.vue";
</script>

View File

@@ -1,17 +0,0 @@
<template>
</template>
<script setup>
const importUrl = 'https://js-na1.hs-scripts.com/46028804.js'
const viteWsUrl = import.meta.env.VITE_WS_URL;
if (viteWsUrl.indexOf('localhost') === -1) {
console.log('loading HubSpot')
let script = document.createElement('script')
script.setAttribute('src', importUrl)
document.head.appendChild(script)
}
</script>

16
src/components/TawkTo.vue Normal file
View File

@@ -0,0 +1,16 @@
<template>
</template>
<!--Start of Tawk.to Script-->
<script type="text/javascript">
var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date();
(function(){
var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0];
s1.async=true;
s1.src='https://embed.tawk.to/66d25a7fea492f34bc0bf6c9/1i6ir30oe';
s1.charset='UTF-8';
s1.setAttribute('crossorigin','*');
s0.parentNode.insertBefore(s1,s0);
})();
</script>
<!--End of Tawk.to Script-->