{"id":238617,"date":"2016-03-07T15:13:38","date_gmt":"2016-03-07T22:13:38","guid":{"rendered":"http:\/\/css-tricks.com\/?p=238617"},"modified":"2017-02-26T06:40:11","modified_gmt":"2017-02-26T13:40:11","slug":"learning-use-google-analytics-effectively-codepen","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/learning-use-google-analytics-effectively-codepen\/","title":{"rendered":"Learning to Use Google Analytics More Effectively at CodePen"},"content":{"rendered":"

Here’s how most people use Google Analytics:<\/strong> you copy and paste the default tracking snippet into your templates. Look at the pageview data that comes in. That’s all good, but that isn’t the most useful analytics for many sites. Google Analytics can track just about anything. It’s very flexible and very powerful. Philip Walton<\/a> and I co-wrote this article to show you how to do some custom GA stuff to help you collect data you maybe didn’t know you could collect and how you can look at that data in useful ways.<\/em><\/p>\n

<\/p>\n

<\/figure>\n

The Beginning<\/h3>\n

It’s fairly obvious you need some<\/em> kind of analytics for any web app. At the most basic level, you need to know how many people are using the app, and if that number is going up or down. <\/p>\n

The choice at CodePen<\/a> was Google Analytics, because most of the team had used it before. It was free and easy to install. The team did what most people do when installing Google Analytics: we copied and pasted the default tracking snippet and that’s it<\/em>. Nothing custom at all.<\/p>\n

Data started coming in, and after a few days there is a general sense of what pages people were visiting on CodePen.<\/p>\n

The problem is CodePen isn’t a really a pageview-based site, like, say a publication is. What pages people visit tells doesn’t tell the story about how users interact with CodePen. Much more interesting is to know what people are doing on those pages so optimizations can be made to improve their experience.<\/p>\n

Unfortunately, none of the team really knew how to use Google Analytics to get the variety of information needed, so for a long time nothing was done.<\/p>\n

Long story short: Chris meets Philip at CSSDevConf last fall. Philip says a lot of developers are in the same position — not taking advantage of the free, powerful tool at their fingertips. Part of Philip’s job is to teach developers, so in an epic tornado of wins, they partnered up to do smarter stuff with analytics at CodePen and share that with everyone.<\/p>\n

What CodePen Wanted To Get From Analytics<\/h3>\n

Analytics data itself is meaningless if you haven’t figured out what problems you’re trying to solve or what questions you’re trying to answer. CodePen created a list of questions they thought would be useful to them and that would answer real questions they have about usage of the app.<\/p>\n

Here’s a few quickies:<\/p>\n