Hi WeWeb-ers.
I’m trying to integrate a product analytics tool (https://livesession.io/), and the script by itself works great—
<!-- LiveSession.io code -->
<script type="text/javascript">
window['__ls_namespace'] = '__ls';
window['__ls_script_url'] = 'https://cdn.livesession.io/track.js';
!function(w, d, t, u, n) {
if (n in w) {if(w.console && w.console.log) { w.console.log('LiveSession namespace conflict. Please set window["__ls_namespace"].');} return;}
if (w[n]) return; var f = w[n] = function() { f.push ? f.push.apply(f, arguments) : f.store.push(arguments)};
if (!w[n]) w[n] = f; f.store = []; f.v = "1.1";
var ls = d.createElement(t); ls.async = true; ls.src = u;
var s = d.getElementsByTagName(t)[0]; s.parentNode.insertBefore(ls, s);
}(window, document, 'script', window['__ls_script_url'], window['__ls_namespace']);
__ls("init", "abcdefghijklmnop", { keystrokes: false });
__ls("newPageView");
</script>
<!-- END LiveSession.io code -->
However, I’m also trying to integrate it a way that identifies users, and I’m having trouble integrating the tracking code into WeWeb.
I tried using a Xano auth variable in the global website header code, but I received a build error when I tried to publish it. For example, the code I tried to publish looked something like this—
__ls("identify", {
email: `pluginVariables['asbcdef-485d-47be-b433-d43d771c64e1']['user']['email']`,
})
Any idea what went wrong to cause the build to fail? Is there a different type of approach I should be doing to identify auth’d users with a 3rd party product analytics tool?