Using Google Analytics to understand real-time messaging behavior

This is a guest post by Nico Miceli, a Google Developer Expert for Google Analytics, Technical Analytics Consultant on Team Demystified, quantified selfer, and all around curious guy. He blogs at nicomiceli.com and tweets from @nicomiceli.

Hello, my name is Nico, and I love data. I quantify everything, and the Google Analytics Measurement Protocol is my favorite way to do it.

With the Measurement Protocol, I can send, store, and visualize any data I want without having to build a backend collection system. I’ve even used it in my personal life to track my sleep patterns, the temperature in my house, and the number of times my brother’s cat actually uses his scratching post.

So when my team started using Slack, a real-time messaging app for teams, I wanted to get the stats. Which clients are contacting us most frequently? When are the contacting us? More importantly, who on our team is the wordiest and uses the most emojis? Out of the box, the app offered some data, but it wasn’t enough for me to answer all the questions I had.

After taking a look at the technical documentation for the messaging app, I realized that Google Analytics is the answer! With the Measurement Protocol and the Slack Real Time API, I could get SO MUCH DATA!! With help from fellow developer Joe Zeoli, Slackalytics was born.

Slackalytics (in beta) is a simple, open source bot for analyzing Slack messages. Built in node.js, it grabs messages from Slack (using the Slack Real Time Messaging API), does some textual analysis, and counts the occurrences of specific instances of words and symbols. Then, using the Measurement Protocol, it sends the data to your Google Analytics account. 



Screenshot of the report showing the custom metrics (emoji, exclamation, word, and ellipse counts) for different Slack channels.

Because the data gets stored in Google Analytics, you can visualized and analyze within the UI or use the Google Analytics Core Reporting API. I like to combine this data with other information so I have export it all into a Google sheet using the Google Analytics Spreadsheets Add-on.

In this beta version of Slackalytics, I’m using two Custom Dimensions: User ID, Channel Name... and six Custom Metrics: Word Count, Letter Count, Emoji Count :), Exclamation Count !!!, Question Count ???, Ellipse Count...

But this is just a fraction of what’s possible. Slackalytics is open source, so you can build your own version. If you’re a developer: Fork my project on GitHub.

If you’re not a developer: Fear not. You can still create your own messaging analysis bot by following my detailed walkthrough on setting this up.

Developer or not, you can build and test your own bot by using Google Analytics and any communication app that has a realtime API. Find out when your clients ask the most questions, monitor other integrations and bots, find out who talks in ☺     or build your own new Custom Dimension & Metrics combos.

- The Google Analytics Developer Relations team, on behalf of Nico Miceli


Referensi: Google Analytics Blog - Using Google Analytics to understand real-time messaging behavior.