A good or bad naming convention for event tracking can mean the difference between insight and noise. But if every client’s needs are different how do you organize your data so it makes sense? Turns out, that problem has already been solved in a different context: english grammar.
Google Analytics events have four parameters:
- A category
- An action
- A label, and
- A value.
Those four parameters are used to pivot and drill into your data so it’s important to have a scalable naming strategy. Without a good strategy you’ll end up with ambiguity and less effective insight.
I think an organized naming strategy should:
- Be easy to understand at a glance
- Allow drilling down and grouping data to be intuitive and flexible
- And shouldn’t leave a lot of room for ambiguity
The English Grammar Strategy:
The strategy uses English grammar and applies it as a naming convention.
- It reads like english sentences so it’s easy to understand
- It applies to a wide range of clients
- It allows you to drill down or group with a lot of flexibility
- It scales for large sites with lots of stuff to track
Let’s see how it works through an example …
CATEGORIES: Plural nouns
Use plural nouns that describe what data is being looked at.
For example, Videos, Interactions, PDFs, MP3s are good categories. I’m careful not to make them too specific. Whitepapers and eBooks may be too specific because you may have other types of PDFs on the site. What if the client wanted to know downloads for all PDFs not just the white papers? This strategy allows me to group data for those kinds of questions.
Let’s put this into practice: Let’s say we have a few white papers and eBooks in PDF format, and a few videos you can watch or download. My categories would look like this:
- Category: “PDFs“
- Category: “Videos“
ACTIONS: Past tense verbs
Use past tense verbs that describe what action the user took.
Downloaded, Watched, Interacted with, and Logged in with. This makes a lot most sense when you’re drilling down you’re working with conversions for different kinds of media. If you only have one action, like downloads, thats OK. At least you’re leaving room for yourself later when you need to start measuring watching videos.
In practice, let’s say our example users have the ability to view online, download, or bookmark the white papers, eBooks, and videos. My actions would be:
- Action: “Downloaded“
- Action: “Viewed online“
- Action: “Bookmarked“
- Category: “PDFs“, Action: “Downloaded“
- Category: “PDFs“, Action: “Viewed online“
- Category: “PDFs“, Action: “Bookmarked“
- Category: “Videos“, Action: “Downloaded“
- Category: “Videos“, Action: “Viewed online“
- Visitors who took any actions on PDFs
- Number of downloads all together
- Pages visited by people who viewed the PDF online
LABELS: Singular subject noun
Use the singular subject noun that is receiving the action.
Some example labels: Free eBook sampler, Full paid eBook, Client Case Study, Effective Strategies 2013 White Paper, Introduction Video, Tutorial Video #1.
They are all singular and it is what receives the action. Be careful. The label must be totally unique for the strategy to work.
In practice, let’s say we have a Free eBook Sampler, a 2013 whitepaper, a short intro video, and a full Tutorial video. My labels would look like:
- Label: “Free eBook Sampler“
- Label: “2013 Whitepaper“
- Label: “Intro Video“
- Label: “Tutorial Video“
- Category: “PDFs“, Action: “Downloaded“, Label: “Free eBook Sampler“
- Category: “PDFs“, Action: “Viewed online“, Label: “Free eBook Sampler“
- Category: “PDFs“, Action: “Bookmarked“, Label: “2013 Whitepaper“
- Category: “PDFs“, Action: “Downloaded“, Label: “2013 Whitepaper“
- Category: “Videos“, Action: “Viewed online“, Label: “Intro Video“
- Category: “Videos“, Action: “Viewed online, Label: “Tutorial Video“
- Category: “Videos“, Action: “Downloaded“, Label: “Tutorial Video“
- (and so on…)
There are a lot more combinations but I think you get the idea.
You have the ability pivot the data in a number of different configurations depending on what you’re trying to measure and gain insight about.
What’s great is that it begins to read like english and translates into Google Analytics well:
- “Show me visitors who downloaded anything.”
- “Show me visitors who viewed any PDF online.”
- “Give me a breakdown of downloads vs viewed online for the tutorial video.”
Event Tracking At Scale
The naming strategy works at scale too. If you have a client with a large site like an e-commerce client or a more complex one like a web-app you’re most likely going to handle this programmatically.
With sites like that you can use the ID of a tag because IDs are usually unique across the markup of the page. Just make sure they’re meaningful like “signup-with-facebook” and not “id-15.” You should look at the IDs in the markup to tell if it’s possible to scale it programmatically.
Now that you’ve collected all this data in Google Analytics how do you get to it and make sense of it all?