Tutorial: Archiving and Visualizing Twitter using TAGS

I archive hashtags on Twitter pretty frequently. (See #kzoo2014, #babel15, #hastac2015here, and here, for example) Whether it’s to provide a record of a conference or to see how a particular community uses the rhetoric of a particular hashtag over time, this functionality has become vital for me. And it’s not that way because I am a programming wizard. It’s because of the amazing and generous work of Martin Hawksey.

Thanks to Hawksey’s TAGS tool, setting up a Twitter archive and a network visualization is amazingly easy. The first time, you will need to set up a Twitter application, but after setting it up once, you will be able to run any number of TAGS archives off of it. This tutorial will guide you through the process of setting it up for the very first time.

What you need:

  • Twitter account
  • Google account (so that you can access Sheets)

Setting up TAGS for the first time:

  1. It helps to be logged in already to both Google and Twitter.
  2. Go to the TAGS website and select “Get TAGS (New Sheets)”
    tags_tutorial1
  3. This will open up a Google Sheet that you will only be able to View. Create a copy, and an identical one will be saved to your Google Drive
    .tags_tutorial2
  4. Check to see if there is a menu item in the top menu list called “TAGS.” If it isn’t there, click on the “Enable custom menu” button toward the middle of the screen.
    tags_tutorial3
  5. Once you have the TAGS button in the menu bar, select it and “Setup Twitter Access”
    tags_tutorial4
  6. It will ask for authorization (which is you giving the script/app permission to run using your Google account).
    1. Click “continue”
      tags_tutorial5
    2. On the next screen click “allow”
      tags_tutorial6
  7. Now that you have given TAGS permission to use Google, you need to give it permission via Twitter. This process involves setting up an API.
  8. Open the link to the https://dev.twitter.com/apps/new
    tags_tutorial7
  9. Fill in the fields – you can name things anything you want and put in a dummy url if you like. BUT make sure to enter the callback URL as https://script.google.com/macros. Then agree to the terms, and you’ve created a Twitter app.
    tags_tutorial8
  10. Go to the “Keys and Access Tokens” area from the top menu
    tags_tutorial9
  11. Copy and paste the API key and API secret into the text boxes back in your Google Sheet, and select Authorize. Then click “next”.
    tags_tutorial10
  12. You will be taken to a new tab that says “This app needs authorization to run.” Click “continue”, and you will be prompted to provide access to another script (Twtr Service) via your Google account. Click “allow.”
    tags_tutorial11
  13. Then you will need to connect to your Twitter account. Click “sign in with Twitter.”
    tags_tutorial13
  14. Click “Authorize app” to give permission for the app you created to use your Twitter account to access Twitter feeds and search capabilities.
    tags_tutorial14
  15. Back in your Google Sheet, exit out of any open boxes. In the middle of the screen, enter whatever search term or phrase you want to archive. This could be a hashtag, a series of hashtags, a handle, or a combination of those. This box acts as a search box within Twitter. [Unfortunately, you cannot enter a Twitter List you created to be archived.]
    tags_tutorial15
  16. Under the TAGS button on the menu bar, I like to go ahead and click “Add Summary Sheet” and “Add Dashboard Sheet” right away.
    tags_tutorial16
    Two new sheets will be added in addition to the “Readme/settings” and “Archive” sheets that were already there.
    tags_tutorial17
  17. Under the TAGS button again, click “Run Now!” and “Update archive every hour.”
    tags_tutorial18
    Now you have a running Twitter archive! You will notice that the Archives sheet will start to fill with results – sometimes it takes a little while for past tweets to populate the sheet. Remember that TAGS can only provide tweets from around about the past week. Download the archive as an Excel or csv file as a backup and/or to clean or play with the data.
    tags_tutorial19
  18. In the Dashboard sheet, you’ll see some trends information about the tweets you’ve gathered.
    tags_tutorial20
  19. In the Summary sheet, you can see top tweeters, average number of Retweets, etc. There are also two links to additional ways of viewing the data:TAGS Archive (a searchable archive of tweets) and TAGSExplorer (a network visualization).
    tags_tutorial21
  20. Before opening either of these options, you’ll need to publish your sheet to the web. First, go to “Share” in the top right corner of the screen. Click “get shareable link” and adjust settings so that “anyone with the link can view”. Then click “Done”.
    tags_tutorial24
  21. In the main menu of the page under “File” select “Publish to the web” and click “Publish.”
    tags_tutorial25
  22. Now back in the Summary sheet, if you click on TAGS Archive, you’ll be taken to a new tab with a more user friendly search functionality than the “Archives” tab of your Sheet.
    tags_tutorial22
  23. In the Summary sheet, click on TAGSExplorer, and you’ll be taken to a new tab where a dynamic network visualization will show the participants of the archive. You can explore the top tweeters, search the archive, and click on individual nodes to learn more about what has been said.
    tags_tutorial23

The first time setting things up requires many steps, but as you can see, they are mostly a matter of getting permissions set up. To set up a new TAGS archive after having done it once, just make a copy of the TAGS template, enter your search term, and click Run Now!

Leave a Reply

Your email address will not be published. Required fields are marked *