A hands-on guide to making predictions with your Google Analytics data.
Last week, we covered how to make data predictions from your Typeform responses. We wanted to continue the trend of making data predictions from data collection tools you already have in place.
We’re going to teach you how to:
- Export your data to a Google spreadsheet
- Format your data for meaningful predictions
- What you can predict with your Google Analytics data
Let’s get it! 💪
Google Analytics is an essential part of the data collection process
Google Analytics (GA) is an essential part of website and app data and learning the basics of how your audience discovers your site, how they interact with your content, which content leads them to purchase, how much time they spend using your product, and more.
It’s one of the simplest analytics tools out there and certainly one of the most common. If you don’t have GA connected to your site, click here to learn how.
Because GA is so good at collecting tons of valuable data and allows you to segment audiences and times, it’s a natural fit for machine learning.
How to Export and Format Your Data
While GA is an extremely powerful tool, it does come with a learning curve. It can be confusing to know what you can accomplish with all this data. GA helps you visualize data and segment, but there are nuances to the tool.
If you don’t consider yourself fully literate in GA, check out this awesome guide.
To start, we’re going to act as if we want to predict what factors lead to a web visitor converting. This will teach you how to export and format your data to upload into Obviously AI.
In the left navigation bar, under Reports, click the Audience drop-down button, and then click User Explorer.
This will take you to the User Explorer report page with a table of rows and columns.
It’s important to note to follow our 1,000 rows by 5 column rule to make a meaningful prediction. This table will only show 10 rows. Before you export this data, you need to do the following.
- Change the row number. At the bottom of the table, adjust the Show Rows number to 1,000 or more. If the rows are below 1,000, you will not be able to upload into Obviously AI and make a prediction. If you can, choose over 1,000 rows. The more data you have, the better prediction you will get.
- Select the date range. In the top right corner, you can adjust the date range for the dataset you want to export. If you don’t have over 1,000 rows, you can adjust the date range to span over a longer period of time to get more data. If you have tons of traffic, having enough data shouldn’t be a problem, but if you are a newer site or SMB, having a bigger date range will be useful.
- Lastly, choose how you want to segment your users. You can simply choose All Users or something more specific. Here we have examples of the type of user segmentation you can perform. You can make data predictions from users you receive organically, paid ads, or social media channels. If you want to be hyper-specific you may have to create your own groups. We have segments of users coming in from specific websites and see how likely they are to make a purchase.
Okay, now you’re ready to export. Just hit that Export button and follow steps on the next page. You will have the option to export as a CSV file, however, we still need to do some light cleaning before getting the dataset ready for Obviously AI.
Formatting Your Dataset
By now, you should’ve made it to the Google Sheet with your exported data. It should look something like this.
Luckily, the dataset already comes with an identifier column in the form of Client Id and 5 columns. You can add more columns by setting up Goals. Our goal here in the Goal Conversion Rate column is simply the percentage of that user visiting a blog post every time they come to our site. This goal helps us tell how much reading our posts relate to conversions. You will also need to set up transactional data to relate any attributes to Revenue and Transactions.
GA makes formatting your data for ML very easy. All you have to do is delete rows 1-6 so the column names are the first row and to rename your goal column to something your whole team can understand. In this case, we’d rename it to something like Post Conversion %.
Now your dataset should look something like this.
When you’re ready, hit the File button in the top left of the navigation bar. Click Download, then the Comma separated values option, and your CSV file will save to your computer.
Uploading Your Google Analytics Data and Making Predictions
On to the main event. Let’s see what kind of predictions you can get with your GA data.
Head to Obviously AI and upload the CSV file to start making predictions.
After you upload your CSV file and set the parameters, you can decide what to column to predict. We predicted Revenue and used the Client ID as the identifier column.
Instantly you can see what factors lead to revenue. Here, our goal is to get a user to visit a blog post, now we can prove that those who read a blog post are more likely to contribute to revenue.
Taking this one step further, you can group your site's content in GA and get a more specific idea on what kind of content generates revenue.
You can also predict transactions and see that the higher bounce rate a user has the less likely they are to make no transactions.
Other things you can predict:
- Which posts are more likely to perform the best
- What type of users are more likely to make a transaction
- What pages relate to the most revenue
- How do traffic spikes relate to transactions and revenue
And more. Hopefully you are inspired to make your own predictions by now 😉
We will continue to share how to use data collection tools for Obviously AI as we believe the hardest part of no-code machine learning is knowing how to take action from your data and having a clean dataset ready for predictions.