Google Analytics is a great tool for tracking your website's progress. It contains a lot of features that are quite powerful and these properties can give some useful insights. Moreover, by using the User ID feature, you can easily get detailed analysis and report of your website's audience. Ultimately, this leads to better results, insights, and overall tracking of the individuals logged in.
Yes, you heard that right. It is completely POSSIBLE to track an individual using Google Analytics. It is very important to analyze your complete website or an individual page to get real statistics like page view, traffice source, device, country etc.
In addition, suppose we are running a web portal where we have a set of active users and we need to track each of their registration, login, purchase etc. So I advise you to read the complete article to clear the understanding.
Therefore, we will talk about everything from scratch. From Google Analytics Login to tracking the tracking process. Here are the main steps:
The first step is to log in to Google Analytics. For those of you who are already pro, please skip to step 3. Therefore, to start the whole process, you just have to create an account for your website. You can take a look at the image below for some help.
After entering the info, click "Create" and accept all the terms and conditions for Google Analytics. That's pretty much it for the first step.
After entering the info, click "Create" and accept all the terms and conditions for Google Analytics. you will be asked the Site's name, URL, and the industry. Just fill that out and click on "Create"
In this step, you will have to go to Admin > User Management > Tracking Info > and click on User ID. (Take a look at the image below).
After that, scroll down and check "I Agree to User ID Policy"
After logging into Google Analytics, there are a lot of options. Therefore, to make this easy for you, we have compiled an easy process. Now, you have to enter a custom dimension that will generate a code for you. The need for creating a custom dimension is to send the data to Google for analysis purposes. Therefore, we have a lot of users. From people who do not log into the site and use it. There are admins and general users to consider too.
This is exactly why we need to create a custom dimension as "User-Type". So that we can identify it only as users. You can take a look at the screenshots.
On the admin page, click on Custom Definitions and then Custom Dimensions. Enter the custom dimension name to "User Type" and click create. Your Google Analytics ID will generate a Javascript code that we now have to edit and modify.
From here on out, the process can be a little tricky. Make sure to close the door and lock yourself (Just Kidding). From the previous step, we have this code for adding custom dimensions:
ga('set', 'dimension1', dimensionValue);
You have to add this code to your Google Analytics Tracking ID. So just for clearing things out. The "Dimension 1" in this code is the custom dimension that you created a while ago. The "User Type" can be anyone depending on the state of your application. It can be a user, admin, a member, or even an author of your site.
In Google Analytics, this is the tracking code for users who are non logged in.
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-177621541-1', 'auto');
ga('set', 'dimension1', 'Visitor');
ga('send', 'pageview');
</script>
Note: You have to replace the UA-ID according to your website
Moving on to the logged in user, the code will be as follows.
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-177621541-1', 'auto');
ga('set', 'userId', '192');
ga('set', 'dimension1', 'Author');
ga('send', 'pageview');
</script>
Note that we have set the dimension value to "userID" and the 192 is a primary key to keep track of everything. It identifies different users.
All in all, the data is now captured and it's being sent the Google for tracking purposes. To take a look at the report, Google has provided us an option called "Custom Reports". You can quickly add custom reports and view them to your liking. There are a lot of things that you can check when it comes to creating the reports.
You can add different metrics and create your custom reports. It's easy and simple to understand in the Google Analytics Website.
Moreover, you have to be wary of using people's information as it's privacy. You must tell the audience that you're using this feature. Moreover, by making sure that this feature is legal in your region, you can get the whole process started.
To check the reports, you can go to the "User Explorer" in Google Analytics. There, you will see the user Id that is passed from the Google Analytics application.