I'm having difficulty using this example of code to link my hypertext to my Google Analytics account:
https://groups.google.com/forum/#!topic/tweecode/ENbun6TbfiI
The tutorial is very useful and accomplishes exactly what I want to do, however when it gives as the example of using a macro to track each passage, it's suitable for Twine 1.0:
<<set ga('send', 'event', 'passage', 'loaded', 'PASSAGE NAME HERE'); >>
When I try and write this for Twine 2.0 Harlow, I write it as:
(set: ga('send', 'event', 'passage', 'loaded', 'Introduction'))
But when I try and run this, the notification I get is:
The (set:) macro needs 1 more value.
The (set:) macro must only be given an assignment operation
Is there something wrong with my code here, or does the problem lie somewhere else?
Does an alternative way exist of using Google Analytics and tracking events with Twine 2.0?
Comments
For Harlowe: I believe that the <script> tag is available in current versions of Harlowe, so you should be able to do something like the following:
For Snowman:
For SugarCube:
I am adding my test file so other people can see how it works. An alternative might be
http://blog.ivybaumgarten.com/twine-macros-for-google-drive-spreadsheets/