I'm trying to get an average or most common path, to recreate it for a live audience. I tried looking at the html that harlowe or sugarcube pushes out and I'm sort of at a loss. I do have JS experience though and understand the basics of analytics, but I wonder if you guys have any better idea on how to do this?
Thanks!
Comments
It is not clear from your question if you only want to track which Passages the Reader visited or if you want to track which links they clicked on. There can be a difference between the two because a link does not have to result in a passage traversal.
If all you want to do is know which passages were visited then this can be achieved by either looking at the collection returned by Harlowe's (history: ) macro, (I believe) in SugarCube 1's case by using the length and index properties of the History API, and (I believe) in SugarCube 2's case the length and index properties of the State API.
If you want to track which links the Reader clicked on then you will need to use your own collection variable to do that, either within your passage code or within some Javascript monitoring the click events of the links.
Assuming you just want the followed path data or something to that effect, then the following should work in any story format, though the implementation details will vary:
Regardless, and again, it depends on the exact details you wish to track.
Thank you for your answer! I'll try to post my code for others when I'm finished.