I am new to Google Apps Script Add-on. I want to implement fullStory for data capture and user experience. I had developed the fullstory in the excel add-in successfully, but when I tried to create the same for the google app script add-on it was not working. I have added the script tag in google sheet add-on but it's not working as per it's document.
I have followed the below step:
https://help.fullstory.com/hc/en-us/articles/360020828273-Getting-Started-with-FullStory
I have added the below script in head section of add-on HTML file.
<script>
window['_fs_host'] = 'fullstory.com';
window['_fs_script'] = 'edge.fullstory.com/s/fs.js';
window['_fs_org'] = 'id';
window['_fs_namespace'] = 'FS';
(function(m,n,e,t,l,o,g,y){
if (e in m) {if(m.console && m.console.log) { m.console.log('FullStory namespace conflict. Please set window["_fs_namespace"].');} return;}
g=m[e]=function(a,b,s){g.q?g.q.push([a,b,s]):g._api(a,b,s);};g.q=[];
o=n.createElement(t);o.async=1;o.crossOrigin='anonymous';o.src='https://'+_fs_script;
y=n.getElementsByTagName(t)[0];y.parentNode.insertBefore(o,y);
g.identify=function(i,v,s){g(l,{uid:i},s);if(v)g(l,v,s)};g.setUserVars=function(v,s){g(l,v,s)};g.event=function(i,v,s){g('event',{n:i,p:v},s)};
g.anonymize=function(){g.identify(!!0)};
g.shutdown=function(){g("rec",!1)};g.restart=function(){g("rec",!0)};
g.log = function(a,b){g("log",[a,b])};
g.consent=function(a){g("consent",!arguments.length||a)};
g.identifyAccount=function(i,v){o='account';v=v||{};v.acctId=i;g(o,v)};
g.clearUserCookie=function(){};
g.setVars=function(n, p){g('setVars',[n,p]);};
g._w={};y='XMLHttpRequest';g._w[y]=m[y];y='fetch';g._w[y]=m[y];
if(m[y])m[y]=function(){return g._w[y].apply(this,arguments)};
g._v="1.3.0";
})(window,document,window['_fs_namespace'],'script','user');
</script>
Code of Apps Script
Login.html
<head>
<base target="_top">
<script type="module" src="https://unpkg.com/@fluentui/web-components"></script>
<?!= include('stylesheet'); ?>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/toastify-js/src/toastify.min.css">
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/toastify-js"></script>
<!-- Style CDN -->
<link href="https://fonts.cdnfonts.com/css/graphik" rel="stylesheet" crossorigin="anonymous">
<style>
body {
margin: 0;
padding: 0;
}
</style>
<script>
window['_fs_host'] = 'fullstory.com';
window['_fs_script'] = 'edge.fullstory.com/s/fs.js';
window['_fs_org'] = 'id';
window['_fs_namespace'] = 'FS';
(function (m, n, e, t, l, o, g, y) {
if (e in m) { if (m.console && m.console.log) { m.console.log('FullStory namespace conflict. Please set window["_fs_namespace"].'); } return; }
g = m[e] = function (a, b, s) { g.q ? g.q.push([a, b, s]) : g._api(a, b, s); }; g.q = [];
o = n.createElement(t); o.async = 1; o.crossOrigin = 'anonymous'; o.src = 'https://' + _fs_script;
y = n.getElementsByTagName(t)[0]; y.parentNode.insertBefore(o, y);
g.identify = function (i, v, s) { g(l, { uid: i }, s); if (v) g(l, v, s) }; g.setUserVars = function (v, s) { g(l, v, s) }; g.event = function (i, v, s) { g('event', { n: i, p: v }, s) };
g.anonymize = function () { g.identify(!!0) };
g.shutdown = function () { g("rec", !1) }; g.restart = function () { g("rec", !0) };
g.log = function (a, b) { g("log", [a, b]) };
g.consent = function (a) { g("consent", !arguments.length || a) };
g.identifyAccount = function (i, v) { o = 'account'; v = v || {}; v.acctId = i; g(o, v) };
g.clearUserCookie = function () { };
g.setVars = function (n, p) { g('setVars', [n, p]); };
g._w = {}; y = 'XMLHttpRequest'; g._w[y] = m[y]; y = 'fetch'; g._w[y] = m[y];
if (m[y]) m[y] = function () { return g._w[y].apply(this, arguments) };
g._v = "1.3.0";
})(window, document, window['_fs_namespace'], 'script', 'user');
</script>
</head>
macro.gs
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('Custom Menu')
.addItem('Show sidebar', 'showSidebar')
.addToUi();
}
function doGet() {
return HtmlService.createHtmlOutputFromFile('home');
}
function include(filename) {
return HtmlService.createHtmlOutputFromFile(filename)
.getContent();
}
function showSidebar() {
var html = HtmlService.createTemplateFromFile('login').evaluate().setTitle("Add-on")
SpreadsheetApp.getUi()
.showSidebar(html);
}
I have provided the image of network pane for fullStory.
Image of privacy Section
Here is the link for fullStory document.
https://developer.fullstory.com/introduction
I don't know why it's not working.
Can anyone guide me on this?