Skip to content

Instantly share code, notes, and snippets.

@ChapelR
Last active September 14, 2020 05:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChapelR/690c89fd8349f3cf465a04a6de226666 to your computer and use it in GitHub Desktop.
Save ChapelR/690c89fd8349f3cf465a04a6de226666 to your computer and use it in GitHub Desktop.
Newbie Guide for tw-analytics

This document originally written by Somnium. Thank you for your contribution!

If you are a beginner Twine user and want a little extra help, here is a step-by-step guide for using TW-Analytics to add Google Analytics to your story.

For WINDOWS:

  1. This requires NodeJS; go to this address and install the "LTS" release: https://nodejs.org/en/
  2. Wait for Node.js to finish installing. You will probably need to reboot your PC.
  3. Open the win command prompt (either search for "cmd" in the start menu or presss WIN KEY + R and type cmd and press enter)
  4. The command prompt will open. Type npm i -g tw-analytics and press enter.
  5. Now it's time to make your Google Analytics account. Go to https://analytics.google.com/ and make one. When you're done, take note of your analytics ID
  6. Now it's time to patch your story. We recommend making a new copy of it just in case. Let's say it's called Story_copy.html
  7. Go to the folder where Story_copy.html is located. Press ALT + D. You will go to the nav bar. Type cmd and press enter.
  8. The command prompt is now open and the working directory is set to the folder. To patch the file, type twga --id=GA-11111-1 -i Story_copy.html into the command promt, where:
  9. GA-11111-1 is your Google Analytics ID and Story_copy.html is your story file's name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment