feat: Configure Chatwoot & Analytics for SaaS app (#2975)
* feat: Add Chatwoot support inside Chatwoot SaaS * Fix identity issues with Chatwoot
This commit is contained in:
@@ -48,6 +48,14 @@
|
||||
}
|
||||
window.errorLoggingConfig = '<%= ENV.fetch('SENTRY_DSN', '')%>'
|
||||
</script>
|
||||
<% if @global_config['ANALYTICS_TOKEN'].present? && @global_config['ANALYTICS_HOST'].present? %>
|
||||
<script>
|
||||
window.analyticsConfig = {
|
||||
token: '<%= @global_config['ANALYTICS_TOKEN'] %>',
|
||||
host: '<%= @global_config['ANALYTICS_HOST'] %>',
|
||||
}
|
||||
</script>
|
||||
<% end %>
|
||||
<%= javascript_pack_tag 'application' %>
|
||||
<%= stylesheet_pack_tag 'application' %>
|
||||
</head>
|
||||
@@ -55,21 +63,14 @@
|
||||
<div id="app"></div>
|
||||
<noscript id="noscript">This app works best with JavaScript enabled.</noscript>
|
||||
<%= yield %>
|
||||
<% @global_config['CHATWOOT_INBOX_TOKEN'] %>
|
||||
<% if @global_config['CHATWOOT_INBOX_TOKEN'] %>
|
||||
<% if @global_config['CHATWOOT_INBOX_TOKEN'].present? %>
|
||||
<script>
|
||||
window.chatwootSettings = {
|
||||
hideMessageBubble: true,
|
||||
position: 'left',
|
||||
};
|
||||
window.chatwootSettings = { hideMessageBubble: true, position: 'left' };
|
||||
(function(d,t) {
|
||||
var BASE_URL="";
|
||||
var BASE_URL="https://app.chatwoot.com";
|
||||
var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
|
||||
g.src=BASE_URL+"/packs/js/sdk.js";
|
||||
g.defer = true;
|
||||
g.async = true;
|
||||
g.src=BASE_URL+"/packs/js/sdk.js"; g.defer=true; g.async=true;
|
||||
s.parentNode.insertBefore(g,s);
|
||||
s.async=!0;
|
||||
g.onload=function(){
|
||||
window.chatwootSDK.run({
|
||||
websiteToken: '<%= @global_config['CHATWOOT_INBOX_TOKEN'] %>',
|
||||
|
||||
Reference in New Issue
Block a user