Fletcher Richman – Hacks & Thoughts
Fletcher Richman – Hacks & Thoughts

A series of guides on hacking the boring processes in startup life.

Get all my new posts!

Electrical Engineer and Entrepreneur turned VC. Partner @ Kokopelli.vc, started Spark Boulder in college.

The hacker’s guide to web & mobile analytics

Fletcher RichmanFletcher Richman
TLDR; I show you how to set up your analytics infrastructure with Google Analytics and Heap Analytics, in a way that makes it easy to add other analytics tools. Then, I show you how to setup an automated Slack or Email message with Google Analytics stats. 


This is the second part of a series of step-by-step guides that help entrepreneurs with boring but important processes that improve their companies. Instead of just ideas or philosophies, these guides provide specific steps and scripts to automate the most repetitive part of tasks that almost every business has to endure.

The focus of this guide is something I’m really passionate about — analytics. A lot of companies today talk about being “data-driven.” In order to do that, you have to have data! I’ll walk you through the process of quickly and easily installing basic analytics tools, identifying fundamental KPIs, and building simple email and Slack notifications to unify your employees, mentors, and investors.

Get my hacks in your inbox!

Client side vs. server side events

Step one is to start tracking user interactions on your app or website. It’s important to understand the two different kinds of events that can be tracked:

Different types of events have different tools that are best suited to track, measure, and analyze them.

One tool to rule them all

One of the biggest challenges in analytics is choosing which tool to utilize. It’s a super crowded landscape, and each tool has its own implementation process that takes development time away from focusing on the product. I think this is why a lot of companies don’t implement analytics in any meaningful way.

Luckily, there is a great solution to that problem, and it’s called Segment.


I’ve been incredibly impressed with Segment since I started using it in 2014. Segment allows you to do one integration for both client and server side events, and then with a simple flick of a button turn on and off a wide range of different analytics and marketing tools.

To install Segment, you need to add their javascript snippet to your site or mobile app, as well as define a few key server-side events such as sign ups and purchases.

If you have WordPress, there is a simple Segment WordPress Plugin you can install. Otherwise, just follow the simple guide they have on installing Analytics.js. You can start with just dropping in the javascript snippet, you don’t have to do an identify call. Depending on your backend, follow the instructions to create a couple of server side tracking events for at least 2 to 3 key actions your users can take — sign up and purchase are good ones to start with.

Must have analytics tools

My 2 must have analytics tools are all free for small projects, and provide a wide range of capabilities.

1. Heap Analytics


Heap is just a few years old but I love what they are doing. From the first day you install Heap, it tracks every click, form submission, and page view and uniquely identifies it based on the HTML/CSS elements in the page and the unique information it can gather about the user. Since it tracks everything, you can retroactively define user segments or actions using their visualizer. I love Heap’s funnels, they provide a ton of insight on where users are dropping off. It’s only free for really small sites, but their badge program helps out cash constrained startups. Sign up here, then just take the id from the onboarding page:


The ID here is 34135210285. Copy that into your App ID of Segment, and enable the integration.


That’s it. Your all setup with Heap.

2. Google Analytics


Google is still a power player in the space and important to get setup. Google Analytics will help you understand where users are coming from, what channels are driving the most valuable users. Google Analytics is especially useful while you are measuring and improving your Search Engine Optimization (SEO).

If you don’t already have an account, sign up at google.com/analytics, and then go to Admin -> Select the account you just set up, click Tracking Info -> Tracking Code. You should see something like this:


If you already have Google Analytics integrated into your site, remove the website tracking snippet from your site.

Copy that ID into Segment, enable the integration, and you’re up and running there too!


Visitors to your site should now be tracked in both Heap and Google Analytics. Your Segment dashboard should look something like this:


Time to figure out what to actually measure.

What you should be measuring

There is no need to create a bunch of arbitrary metrics just to have more data. Many startups fall into this trap and spend too much time digging for data when their data sets are too small to get major insights.

You should focus around a core set of Key Performance Indicators for the business that compliment some qualitative metrics, the combination of which you can rally everyone around. For the purposes of this blog post, I’m going to skip over financial metrics such as Burn Rate, Revenue or Monthly Recurring Revenue (MRR), Gross Margin, etc. I recommend a tool like Visible.vc or Periscope for those higher level metrics.

Your analytics tools are great at measuring and improving your company “Growth.” I break Growth into two distinct categories.

  1. Increasing the size of your funnel — if drive more people to your product, that results more growth.
  2. Improving the conversion down the funnel — if more of the people that find out about you become users or customers, that results in more growth.

Super simple, but that is the point. I’ll keep re-iterating, don’t over complicate your metrics. Here’s what to focus on:

You may already have ideas about the answers to these questions, which is good. The data should just guide you towards confirming or denying those assumptions.

Traffic Sources

Let’s start out with where the traffic is coming from. One of the best places to look at this data is in Google Analytics under Acquisition -> All Traffic -> Source/Medium. Given any date range you can see the referral sources for all of your traffic.


Focus on the referral sources that are getting you the largest amount of high quality traffic. In my case, it looks like Twitter results in only 4% of my traffic, but users spend significantly more time on site than from other sources, indicating that they are higher quality users. I knew that social was my primary source of traffic, but this allows me to focus more on places like Reddit and Twitter as my best sources.

Defining the Funnel

Now that we have some idea of the different traffic sources, we need to define the key parts of your funnel to better understand the quality of traffic and where users are getting stuck.

We’ll use the Heap Analytics visualizer to jump in and define these quickly.


In your case, it’s probably something like searching from the homepage, clicking a certain button or submitting a certain form, signing up, and then purchasing, following, etc.

For my blog, there is one simple thing I want people to do. Subscribe. So I can define events for the various places people can subscribe:

1--nMwmXMw0SoUJc7Q-0g5tw 1-V_74hJCqk9guhyAQiuyafA

Visualizing Conversions

Now that you have events defined in Heap, you can use their Graph tool to understand what the referral source is for users that do those actions. You simply add the event you are interested in to the first field, and then choose group by “Initial Referrer”. (If you are interested in looking at two different events that represent the same action, you can combine them to create a combo event).

1-9knTY2VgDRfFPB0BNAlOkQ (1)

Looks like over the past few days I’ve had a couple of subscribers come directly to my site, and one come from the galvanize.com post I syndicated to. These are by no means huge data sets that I can predict what will happen next with, but they give me some evidence of which sources are leading to conversions.

You can also build a funnel of the various actions your user can take, in my case it’s just two steps:


I’m pretty proud of this 5% conversion, that’s pretty high for conversion on a blog post to subscription. However, once again the data set is very small, I need thousands of hits before I can rely on this as a sample size that I can compare across. This is one of the situations where it’s good to start getting data early but the data won’t be as valuable until further down the road.

Keeping everyone informed on a regular basis

Now that you have generated some great data sets and graphs, you need to share them with your team. In Heap, you can use the Email Settings on each report to send to your team on a weekly or daily basis:


For Google Analytics, there are a few options. There is a great google sheets addon you can use to create custom dashboards. I’m a big fan of Slack and I think it’s starting to become the business dashboard for many companies. You can have your Google Analytics metrics sent to both Email and Slack on a weekly basis using CloudPipes.

After you sign up for an account, create a pipeline.


Search for the Google Analytics channel, add and configure it:1-FcEaNRNLRnzwY5CGM-6EKg

Add and configure Slack the same way. Then drag and drop Google Analytics “Generate a Report” into the start of your pipeline.


Fill out the View with the appropriate view from your Google Analytics account (I got a bit stuck here, just go into Admin -> View Settings to see the numbers of the views). To get the same data we got above, select “Sessions” as your Metric, Start Date of 7daysAgo (capitalization matters) or whatever time period you want, and end date of today. The dimension should be “Source / Medium.” Set Order By to Sessions, Descending, and limit the count to 10 or so.


Now we will get it up to either post to Slack, send an email, or both.


Go into Slack -> Messages -> Post a Message and drag it into the “Do” section of CloudPipes.


Select a channel to post to (I made one called #analytics), and then drop in the Sessions and Source/Medium variables into the text, writing something to the effect of

{{a:sourceMedium}} created this many sessions to the site in the past 7 days:{{a:sessions}}

That’s it! Run the pipe to test it out, you should see something to the effect of these messages in your Slack channel:


Looking for more Slack goodness? There’s an amazing Slack Bot called StatsBot that can do complex Google Analytics queries and have them post to Slack immediately or on a scheduled basis.


To send an email including the data, connect your Gmail account, and then drop the “Send an email” link into the pipe, making sure to drop it outside of the “Each” block:


Set the “To” and “Subject” fields appropriately (I recommend sending to your marketing team or maybe your whole team, with subject line: Weekly Google Analytics Data). To insert the data from the report into the body of the email, I wrote a little snippet of markdown that you can download here:

Markdown Download

Now when you run the Pipe, an email should go out with all your data!

Go back to your dashboard and click the little clock button to create a schedule for your Pipe to run:


Boom! Your team will get a slack message and an email once a week with your latest Google Analytics data.

What’s next?

This initial setup should get you started down the path of becoming a data driven company that can predictable increase growth. Continue to dive deeper into Google Analytics and Heap to understand user acquisition channels, search engine optimization, effectiveness of different marketing experiments, and sticking points for customers in the product.

Don’t get too data obsessed too quickly. Most startups don’t have enough data to make statistically relevant decisions until they have been around for many years. Use data to learn about your customers but continue to rely on qualitative information for big decisions. You’ll be glad you started collecting data now because you will have more to work with down the road.

Try out a few other tools through Segment integrations (Mixpanel, Keen.io, Optimizely, and Customer.io are a few I recommend)

Run into any sticking points, have ideas about things I missed or ideas I could add to this guide, or have an idea for a topic I can write a guide about? Post it in the comments.

Get my hacks in your inbox!

Electrical Engineer and Entrepreneur turned VC. Partner @ Kokopelli.vc, started Spark Boulder in college.