Summarize events per session with Google Analytics - google-analytics

Is it possible to summarize events per user (session)?
I have a subscription (CTA) field on the page.
Further down, there is a small just-for-fun questionnaire.
I want to check, if a user is more willing to subscribe if they performed the questionnaire, or if that doesn't matter at all.
So I track an event for a subscription (I configured this as a "Goal" (conversion)), and an event for the questionnaire. But how can I summarize these two events for each user?
Or do I have to implement this analytics with my own AJAX-PHP-MYSQL setup?

If you mean "a row in the report per indidivual user" then GA does not support this (at least not by default, you would need to store an identifier in a custom dimension and query by that).
If you are looking for aggregated numbers you can create a segment ("include sessions where event equals AND goal conversions for > 1". You can then apply the segment to your query to get the total number of users with both conditions, or add more dimensions e.g. to break down by channel, region etc.

Related

Difference between Active Users and Total User in GA4

For a selected date range (last 3 days) I am getting a difference in Active Users and Total Users count. No segment or filter is applied, it is for overall events tracking. I am using Google Analytics 4. If I look for specific events using a filter the value matches. Why is the count different in this case?
If I'm not mistaken, I believe Active Users are the one who engaged (aka didn't bounce, aka did more than 1 request besides the page view to start a session.
This was what I understood from their API help (link here)

How can I view individual hits to pages within a GA custom report

I would like to compare some data between a 3rd party analytics tool and GA.
Now I would love to see the IP addresses that Ga is receiving however it seems that they do not reveal this information, fine, however, I cannot find a way to use the flat table in the GA custom report to show me the following if possible;
Full Date Time (Seems as though they don't want you to have this either)
Browser Version
Browser Width & Height
Page (from the hit)
And I would like this data not to be grouped by the metric, this way I can see that if the same user has hit a page 3 times it isn't grouped.
If anyone can help please let me know. If the question is poorly phrased please let me know.
Thanks,
Connor.
This requires some work, and it will allow the breakdown only for future hits, not for hits that are already collected.
To view individual hits you need to create a hit based dimension that is unique per hit. Unless your page has an amazing amount of traffic a timestamp in milliseconds (e.g. new Date().getTime()) will be sufficient (for your report you might want to format that in a nice way). So in the admin section of your GA property you go to custom definitions, create a hit scoped custom dimension, and then modify your pagecode to send the timestamp to that dimension. Hit scoped means it is attached to the pageview (or other interacton hit) it is sent with.
If you want to break down your report by user you need the clientid (clientid is how Google recognizes that hits belong to the same user). Again, send it as a custom dimension.
This does not tell you how many sessions the user had (there is no session identifier in GA). If you need to know that you can create a session scoped custom dimension and send a random number along ("session scope" means that GA only stores the last value in a session, so you don't need to maintain a session id over multiple pageviews, since the last value will be set for all hits within the session). The number of different sessions ids per client id then tells you the number of sessions per user.
The takeaway is that GA only shows aggregated data, and if you want to defeat this mechanism you need to throw data at it that cannot be aggregated further. You might run into other constraints (i.e. there is a limited number of rows per report).

Aggregate events / goals per user

I would like to know if there's a way to display information based on how many (similar) goals or events were triggered by a unique user.
For instance, let's say I own amazon. For every product I sell, I trigger a 'Purchase' goal (by using an event).
I would like to know:
How many products does an average user buy, in multiple sessions, over a time span. for instance, how many products did an average user buy in the span of a month.
I would like to segment data by the amount of products bought by users. i.e. segmenting my data based on users that bought 0 products, 1-5 products, 6-10, products, and 11+ products.
Is there a way to do so?
You have to get custom dimension/metric in GA. Add a custom dimension 'product_quantity' and get actual number of products bought as metric value in the variable.
Once you get have it, you do calculation of total products divided by users or creating segments based on product_quantity dimension.
Find more info at https://support.google.com/analytics/answer/2709828?hl=en
It is easier with Google Tag Manager. Once you define custom dimension/metric, trigger may be completion of 'Purchase' goal or any event.

Unique events are greater than total events

I'm having an issue with Unique Events and Total events. I don't really understand why unique events are greater than total events (image attached: https://analytics-a-googleproductforums-com.googlegroups.com/attach/584c3c65bd24cfec/Screenshot%20at%202013-05-14%2017:00:40.png?gda=9qkpgUYAAADqfLbDOUx1KZ9vP-6pB8mH0QevsNJBCwpb2zqmxh9R_FqJw8mf6kYUxitGhb4bDE5x40jamwa1UURqDcgHarKEE-Ea7GxYMt0t6nY0uV5FIQ&view=1&part=4).
Someone can explain how this is posible?
Santiago Vázquez
Found the thing: you will see that "Unique Events" are great than "Total Events" when you look at an event category or action, put "Event Label" as a secondary dimension and the event has been triggered some times with no label input. Google Analytics hasn't the option "(not set)" for this particular dimension, so it just doesn't show you those events in the Total Events Count, but still counts as "Unique Events" all the users that executed this particular event category / action.
I am seeing this same issue in my the first view of my Custom Report as well. I don't know WHY it is showing more, but there seems to be a more accurate Custom Report drilldown for you to use. In my reports, one page shows in my Page drilldown with 30 total events but 62 Unique Events. However, when I click into the next dimension drilldown view, in other words click to narrow in on just one page, it shows that same page with 30 total events and only 29 unique events. That seems more accurate.
My dimensions drilldowns for this custom report are "Page" and then "Event Label"
Hope this helps!
I think Google Analytics is simply buggy.
They have to work on event reporting a bit more.
We are tracking events and e-commerce data to our own database, and we realised that both Google Analitics and Universal Analitics misses some events and e-commerce data.
We are trying to find the reason for this, but no luck yet.
If you have a segment applied it's probably sampling. You can confirm or deny sampling is the cause by seeing if there is a yellow background note above the graph but below the date selection on the report page. There is also a grid of filled in and not filled in circles next to the new scholar cap (also below the date selection) sometimes.
Unique events are calculated by session, while total events are determined by the main dimension.
In the example report below, I wanted to look at how many events occurred on each page. The dimension drilldown is Page, with Total Events and Unique Events as metrics.
Users can visit a page, but not send an event by that page ( 0 total events ). However, if their session includes an event, then unique events will be 1 or more.
Custom reports allow data combinations that may not be clear (not sure if someone already posted this point or if I saw it in another thread). Basically, my report should not include Unique Events to prevent this problem from happening, though this was probably the wrong way to go about this altogether.
Template: https://www.google.com/analytics/web/template?uid=XafJ7KvSSf-n5KWWPyvn_g
Google has deprecated (renamed) Unique Events metric as it was seriously confusing. We are expecting to see a number of times event with unique combination of category / action and label happened per other dimensions in report. Instead GA calculated a unique combination of every dimension in the report!
Now, this metric is deprecated and renamed to legacy.
New one: Unique Events is giving expected results.
I written about why total events are higher than in my blog as too many questions.
Total Events are calculated as the total number of interactions with a tracked web page object. On the other hand, where a single user session (or visit) has one or more events, this is calculated as a single Visit w/Event, or Unique Event in the reports. For example, if one user clicks the same button on a video 5 times, the total number of events associated with the video is 5, and the number of unique events is 1.

Doing cohort analytics on Google Analytics

Suppose I have 65 people that register on January 1, 2012.
I want to find out how many of those 65 people returned to the site that same week. (More generally, if n people signup on date A, I want to be able to find out how many of those n people return in a given date range.)
Is there a way to do this using Google Analytics? If so, how? I am currently getting the user's username for each page hit.
If you only need to track people who sign in then you don't need to get very fancy. You can copy the relevant user attributes, such as sign up date, from your DB to GA using events or session level custom variables.
But if you want to track everyone, including those who don't sign up, then you'll need to use visitor level custom variables (GA cookies).
I explain how to set this up in detail in this post so I'll just highlight the key points here:
First, decide how to layout the data in Google Analytic's custom variables based on your requirements. For example, are you storing retention dates for daily, weekly or monthly tracking? Do you also want to track cohort goals? Partition this data into the available custom variable slots.
Write the cohort data to these custom variables when visitors arrive or achieve goals using Google Analytic's _setCustomVar function. Setting the fourth parameter of that function to 1 indicates you want to do visitor-level (cookie) tracking.
For each cohort you wish to analyze, create an advanced segment in Google Analytics. Using a regex expression in the condition will give you the flexibility to segment for interesting cohorts. ex: "All users whose first visit was the week before Christmas".
Analyze the results with reports by specifying a date range and the corresponding cohort-sliced advanced segments. Another option is to extract the data using the Google Analytics Data Feed Query Explorer or their API.
Once you've put in the work your new visitors will be stamped by their first visit date and nicely fall into each daily or weekly retention bucket. This is what it might look like if you were tracking weekly retention, for example:
This is not a full solution, but here are some points on how I would approach this problem with the help of Google Analytics:
You have to make sure that you somehow store the registration date of each user, either in your database or in a cookie. Then have a look at Google Analytics Event Tracking. You could for example set up a new category based on the registration date. On every page load in your page, you then have to set up this event tracking call, for example like:
_trackEvent("returns", "2012-01-01", "UserId:123123123")
This way you will receive all page views for users that registered on that particular date. To add a date range in this, you have to make sure that these events only get fired for the number of dates after the signup (e.g. 7 days).
After your date range, you will be able to see how many page views and how many users returned - you even know which users came back.

Resources