I want to query the number of Daily active user from Google analytics API, by the Event label.
In details:
I have 2 event Categories, each contain 2 Event label. like this:
(Category) -> (Action) -> (Label)
1. ui_category_A -> ui_action -> Click_button_A
2. ui_category_A -> ui_action -> Click_button_B
3. ui_category_B -> ui_action -> Click_button_A
4. ui_category_B -> ui_action -> Click_button_B
I want to query the Google analytics with API, to extract the number of daily active user, who have tracked the event with (1.) only.
How to do the query with parameters?
Thanks!
To extract these data you should construct the API request with the library of your choice. Whichever you choose I will provide you with the parameters that will give you the results you want.
metrics: ga:users
dimensions: ga:eventCategory,ga:eventAction,ga:eventLabel
filters: ga:eventCategory==ui_category_A;ga:eventAction==ui_action;ga:eventLabel== Click_button_A
start_date: today
end_date: today
If you just want the number of users you can skip the dimensions. Also be aware that the results will depend on the processing time of GA.
If you want real-time results you can look into the beta of real-time reporting API
Related
So let's say for example, I have user_id#1234 in chat room_id#4321 and I'm keeping track of:
The total number of messages for this particular room_id#4321, and
The total number of messages user_id#1234 sends in this room - (It's important to associate the user's messages with the room because I need to track the total user's message count PER each chat room.)
Here's the approach I got so far in my attempt to keep it to one event: On Firestore Analytics, I've created a custom dimension with the event "room_messages" and I'm able to log the events like so every time a message is sent:
firebase
.analytics()
.logEvent("room_messages", {
room_id: room_id,
user_room: `${user_id}-${room_id}`,
});
But particularly for the user_room parameter, since there could be so many users and rooms, is there a limit on the number of parameter values? ie there could be a ton of the event (room_messages) -> parameter (user_room) -> value (user_id-room_id)
And on top of that, how do you even view these events and their parameters for insights? Whether on Firestore or Google Analytics, it seems like I can view all the total events that have occurred just fine, but for viewing the events AND their parameters, I am only able to view that from what events were triggered in the last 30 minutes.
Appreciate any help!
Update: The parameter has to also be defined using Custom Definitions. Now the room_id tracking information shows up on the room_messages event page.
What would be the easiest way to get a report on Google Analytics containing authenticated users ordered by the last login time (the latest login first)?
We are already using Event logging with Category "User", Action "Login" and Label set to user ID (a GUID). Is it possible to base the report on this data?
UPDATE 5-Dec-2018:
As a reference, we have a Custom Report for top logins:
This shows:
Now, I would like to change 'Hits' to "the last time the event occurred", with the given Event Label.
You can create a custom report with the event label ordered by date and time. Though the default implementation in GA only gives you up to the hours I believe. If you want more granularity, I think you'd need to create a custom dimension with a timestamp to the second/millisecond and capture that data front-end.
I am currently trying to send a hit to Google Analytics from my CRM. I have been successful in sending events and purchase as well as products etc. However, when I try to send through a custom dimension I am not seeing this dimension within the user explorer section of Google Analytics.
My example case as follows:
I go to the Google Analytics Hit builder to build a prototype hit for this interaction found here
I send through an event to Analytics as follows; this contains the all important custom dimension:
v = 1
t = event
tid = {{Analytics account ID}}
cid = {{Random string}}
ec = Offline sales
ea = Completed sale
el = Oflline sale completed
ni = 1
cd4 = Sale made
(Don't run the above, you need to enter it into the respective fields in the hit builder)
I validate this hit and as you can see below it will show valid and will send
Image of valid hit
The event shows up in the real time events
However, the custom dimension never shows up in Analytic's user explorer
Could someone please assist?
Since you specifically mention the user explorer report my educated guess would be that your custom dimension is not user scope (which is the only scope the user explorer will show).
Look if you can select them as secondary dimension in your standard reports or build a custom report (or rather more straightforward, check the scope of your dimension in the property settings)
I tried to automate test to validate GA events.
My approach is :-
List item use google analytics real time reporting api.
Before the test ends i will hit this api and collect the last 30 mins data
This data will be a huge chunk of formattedJson string
and in this string i will search my GA events which was supposed to push.
This approach seems to be in-efficient.
My issue is to find the analytics data which corresponds to test user.
Each user has unique user id, hence, i am trying for making the request such that api returns me the filtered data based on some custom dimension "custom:user_id='user_unique_id'" .
Is it possible to get all data having condition e.g 'custom:user_id="XYZ"'.
Please advise, how to get all ga events data for a specific event label / custom dimension ? Also, does it support dimensionFilterClauses like reporting api v4 ?
We can do it by filtering.
e.g rt:eventCategory==ProductPage
earlier i was using quote, rt:eventCategory=='ProductPage' which wasn't supported.
Can I use client ID as a dimension in my reports? Client ID does not appear as a dimension in the Dimensions and Metrics Explorer, but I believe I can create a custom dimension that will store the Client ID. My end goal is to have a row per customer/date+time containing the incidents associated with the particular customer at the particular time, e.g. page visits, particular events etc
Once you've created the custom dimension in GA, you can start tracking it via analytics.js with the following code:
ga(function(tracker) {
// Assumes dimension is at index 1.
tracker.set('dimension1', tracker.get('clientId'));
});
I found that the google analytics will NOT save your custom dimension if it matches the value of "client id" (even if that id isn't actually PII). However, if you alter the "client id" to become a different value, it will save properly.
Here are the guidelines about what you are allowed to send