user
@anneruthj
Tracking of slides visited is not working
Hi,
I have followed the steps and created an excel sheet to track how often a slide is visited, but unfortunately I am not seeing the data in the excel sheet. I do see in clue labs that 232 visits have been done.
reply
Reply
user
@support
When you say you followed the steps, what steps did you follow?
reply
Reply
user
@anneruthj
Hi,

I created an excel sheet, which connected to cluelabs.
I added the variables: clabsSheetsWidgetID; stencilrendered; stencilsheetstoken
I added 2 triggers with javascipt code on the masterslides:
1.
if(!document.getElementById("clabsAnalyticsScript")){let t=document.createElement("script");t.setAttribute("src","https://cluelabs.com/analytics/display/ufsl.min.js?id=e933dcd58bd9cc37d295ea099bd9e259b1cab71ee90e0656280cf2d05e82004d56ac2180dd529b7eeb2ef80f385a42f7cd65"),t.setAttribute("id","clabsAnalyticsScript"),document.head.appendChild(t)}
2.
if(void 0===window.stencilsheets){var player=GetPlayer(),targlink="https://cluelabs.com/stencil/display/widget-sheets-init-v2?authtool=sl&v=1678887612&chart=OTAxfDM1MDN8OGE0ZjQxMWJmNmNkNGEwNzBkZjA5ODU5Y2NiMzM1MTQ";xhttp=new XMLHttpRequest,xhttp.onreadystatechange=function(){if(4==this.readyState&&200==this.status&&""!=this.responseText){var e=this.responseText,t=document.getElementsByTagName("head")[0],n=document.createElement("script");t.appendChild(n),n.appendChild(document.createTextNode(e)),window.stencilsheets=!0}},xhttp.open("GET",targlink,!0),xhttp.send()}

And I added two triggers on each slide (adjusting slidenumber to slide) with Javascript:
1. SheetsSet('Slide 1', 'visited')
2. SheetsGet('Slide 1', 'visited')

I published for 'review'.
reply
Reply
user
@support
The only note so far is that there's no point to do SheetsGet after SheetsSet. If you already know what value you've saved to the sheet, there's no reason to attempt to read this value back into Storyline.

If you want, upload your .story file, we'll check. Note that we don't need your entire project, just that one slide that saves the 'visited' value to the sheet.
reply
Reply
user
@support
1. JavaScript language syntax requires a semicolon at the end of each line. The trigger with the SheetsSet function is missing a semicolon.

2. You missed step 2 of the How to Use... instructions (Set the value of the variable clabsSheetsWidgetID to the following:...).

3. Once these issues are fixed, if this still doesn't work for slide 1, but works for slide 2 then it's probably because you're trying to write to Google Sheets before the sheets widget finishes loading (since both master slide and main slide triggers execute at the same time).
reply
Reply
user
@support
You can set a Storyline trigger to anything, it doesn't have to be slide start.
reply
Reply