TotalUsers are making double - google-analytics

making requests with GA4 Query Explorer
when i request two dimensions together (appVersion and firstUserCampaignId)
totalUsers returns double values
when i request only one dimenstion, sum of totalUsers returns valid values
does it some bug in GA4?
{"dimensions":[{"name":"appVersion"},{"name":"date"},{"name":"firstUserCampaignId"},{"name":"platform"},{"name":"streamId"}],"metrics":[{"name":"newUsers"},{"name":"totalUsers"}],"dateRanges":[{"startDate":"2023-01-27","endDate":"2023-01-27"}]}
i expect that sum value of totalUsers will equals with any set of parameters

Related

Firestore Rules - Datatype Validation

I've read multiple questions in Stack Overflow and the documentation but I couldn't find multiple validations that I can imagine that exist.
Per example, it is possible to check if request.resource.data.description is string but can is it possible to do the same when it comes to number, float, timestamp or even array/list? I couldn't even find the string one in the documentation so I can imagine it is missing more than just that one.
You might want to watch my video on data types in Firebase security rules. In it, I list all the different data types that you can check:
value is bool
value is int
value is float
value is number
value is string
value is list
value is map
value is timestamp
value is duration
value is path
value is latlng

Google analytics API: different sum of sessions with 'ga:eventLabel' function and without it

I added 'ga:eventLabel' function to my script and sum of sessions decreased from 2238 to 994. Why?
I expect the same result from both script
dim=['ga:eventLabel', 'ga:source','ga:sourceMedium']
met=['ga:sessions', 'ga:users']
start_date='2019-07-01'
end_date='2019-07-03'
transaction_type='Goal'
goal_number=''
refresh_token=token
condition=''
data_2=google_analytics_reporting_api_data_extraction(viewID,dim,met,start_date,end_date,refresh_token,transaction_type,goal_number,condition)
viewID='*********'
dim=['ga:source','ga:sourceMedium']
met=['ga:sessions', 'ga:users']
start_date='2019-07-01'
end_date='2019-07-03'
transaction_type='Goal'
goal_number=''
refresh_token=token
condition=''
data=google_analytics_reporting_api_data_extraction(viewID,dim,met,start_date,end_date, refresh_token,transaction_type, goal_number,condition)```
Here are the results:
--
The two queries have two different meanings, and won't give you the same result, unless you have a data set, where all sessions have at least one event type hit associated with them.
The first query says: count all my users and sessions for the given date range, breaking it down by event label, source, source/medium and date. So in this case, you implicitly filter for any known event labels, where (not set) is an empty, but existing label for a recorded event. Sessions without any events are excluded.
The second query says: count all my users and sessions for the given date range, breaking it down by source, source/medium and date (regardless, if they had any events).
You can verify this behavior, if you create these custom reports in Google Analytics web UI. It is similar to querying custom dimensions: if no value was set for a given custom dimension, those records are excluded.

Google Analytics reporting - wider data range filters out the result

I am trying to get a GA's client id stored in a custom dimension by using other custom dimension value filter.
The problem is that I don't know why when I change start-date=2019-01-01 to start-date=2016-01-01 or start-date=2006-01-01 the result I get with start-date=2019-01-01 is gone. Why it happens? I would like to search for all the users.
Is there other method just to find a user based on a dimension, I don't need any metrics.
https://ga-dev-tools.appspot.com/query-explorer/?start-date=2019-01-01&end-date=2019-01-28&metrics=ga%3Ausers&dimensions=ga%3Adimension16%2Cga%3Adimension65&filters=ga%3Adimension16%3D%3DUMM8SBTCS0U7HIZL&include-empty-rows=true
Java:
DateRange dateRange = new DateRange();
dateRange.setStartDate("2018-01-01");
dateRange.setEndDate("2019-01-28");
final Dimension euciDimension = new Dimension().setName("ga:dimension65");
final Dimension gaDimension = new Dimension().setName("ga:dimension16");
ReportRequest request = new ReportRequest()
.setViewId(VIEW_ID)
.setDimensions(Arrays.asList(euciDimension,gaDimension))
.setDateRanges(Arrays.asList(dateRange))
.setMetrics(Arrays.asList(sessionsMetrics)).setPageSize(1000).setIncludeEmptyRows(true)
.setSamplingLevel("LARGE")
.setFiltersExpression("ga:dimension16==XYZ");
ArrayList<ReportRequest> requests = new ArrayList<ReportRequest>();
requests.add(request);
// Create the GetReportsRequest object.
GetReportsRequest getReport = new GetReportsRequest()
.setReportRequests(requests);
// Call the batchGet method.
GetReportsResponse response = service.reports().batchGet(getReport).execute();
Sampling
About data sampling
In data analysis, sampling is the practice of analyzing a subset of all data in order to uncover the meaningful information in the larger data set. For example, if you wanted to estimate the number of trees in a 100-acre area where the distribution of trees was fairly uniform, you could count the number of trees in 1 acre and multiply by 100, or count the trees in a half acre and multiply by 200 to get an accurate representation of the entire 100 acres.
There is no way to disable data sampling in Google analytics api or website. The only way to get around it is to use smaller date ranges. Sampling for the last 12 years will likely always result in sampling unless well you started your site less than a year ago.
You can check the response to see if your data is sampled and then just reduce the number of data until it stops showing up sampled.
Note Big query: you can export the data to a big query account if you have access to that it removes the sampling.
Missing data
If you only started sending a custom dimension yesterday then the data for last week does not contain any values for this custom dimension so the data will not be returned. There is no way to do analytics on against data that did not exist at that time.

Google Analytics for Firebase event parameter data type change

I initially setup a firebase event parameter, say "param1", to be a Text data type because the it contained a leading character in front of 4 numbers. After realizing Firebase severely limits the number of parameters that can be of type "Text" I stripped off the leading character (as it didn't add any value to me) and changed the data type to "Number" (Standard). However, after doing that I don't see "param1" values in my event, even after several days. I assume this is because some of the data for param1 previous had a leading character and therefore can't be displayed as a Number. Any idea how long I will need to wait until Firebase no longer has any param1 data values with the leading character?

Firebase Remote Config: user in randome percentile. Are users assigned only once?

Suppose I create a parameter with conditions such that users in random percentile < 10% will be assigned a certain value. The client fetches this value parameter and gets this value with 10% probability, if not it gets the default value. Next session the client fetches the same parameter. Will he get the same value again? Do users stay in the same percentile indefinitely or is a dice thrown each time they fetch the parameter value?
From the documentation:
Each app instance is consistently mapped to a random whole or fractional number within a project, so you can use a rule of this type to consistently address the same app instances.
For example, to create two related conditions that each apply to a non-overlapping .05% of an app's user base, you could have one condition include a <= .05% rule, and another condition include both a > .05% rule and a <= .10% rule.
So they receive the same value consistently.

Resources