How to use item-scoped dimensions and event-scoped metrics together? - google-analytics

According to the schema changes item-scoped dimensions and event-scoped metrics are incompatible.
Before the changes I used the "itemViewEvents" (event-scope metric) and the "itemName" (item-scoped dimension) to get the number of views for a given product. Is it possible to get this data after the changes? I guess we should create a custom metric/dimension for this, but I'm not sure.

Related

UA Dimensions & Metrics

I am using the GA4 (Google.Apis.AnalyticsReporting.v4) reporting API to create a dashboard for my company.
I noticed that if you select the following dimension:-
TIME/ga:dateHourMinute,
ADWORDS/ga:adwordsCampaignID
ADWORDS/ga:adwordsAdGroupID
with METRICS:-
ga:impressions,
ga:CPC
ga:adCost no data is returned
BUT if you change the selection to dimensions:-
TIME/ga:date,
ADWORDS/ga:adwordsCampaignID,
ADWORDS/ga:adwordsAdGroupID
with METRICS:-
ga:impressions,
ga:CPC
ga:adCost
data is returned. Does anyone know how to get the first query to return data?
The dimension ga:dateHourMinute is not compatible with the metrics ga:impressions, ga:CPC, and ga:adCost. Google Analytics does not store these metrics broken down by date, hour, and minute. If you send the first query, you will get that the dimensions and metrics are incompatible:
You can visit the dimension & metric explorer to plan a query for compatible dimensions and metrics. If you check the fields ga:adwordsCampaignID, ga:adwordsAdGroupID, ga:impressions, ga:CPC, and ga:adCost, then the dimension ga:dateHourMinute is grayed out to signify incompatibility:

Custom dimension vs custom metric

Ok, I'm trying to track when the users get an empty list of products.
The list is defined by a filter, I want to first know if there's a lot of people getting empty results to take some action like tracking what's the filter combination they're using, anyhow...
To picture it, this is what I want to achieve:
But I'm confused between the custom dimension and custom metrics. In my head, all I need is a custom metric (Cause the amount of empty results sounds like a metric to me).
So I created an "Empty list results" custom metric with the scope of Hit. And I'm passing just an integer 1 to this custom metric.
But it doesn't show what I need. Am I missing something?
UPDATE
Including every hit to the page, even when I'm not sending the custom metric index/value pair
In this example:
/custom-metric-test-1 does not include the custom metric index/value
/custom-metric-test-2 does include the custom metric index/value
But they both show in the report. It's like my custom metric it's just an alias for hits.
You can use a metric or a dimension, it depends on the result you want to get (read), in all cases you can have the number of times a page has a certain characteristic (in your case the empty product list).
Use a custom report, i.e. with flat table, put 'page' as a dimension and your custom metric as a metric. Page and hit are the same scope so the queried pair of elements shouldn't give you strange results.

Microstrategy multiple filtered metrics based on same attribute

I have an attribute called vehicle type and I want to create two filtered metrics based on this attribute. so I created two metric that gets count of vehicle and applied filter vehicle type = bus and vehicle type = car on the other one. on my report I want to show a line charts with these two metric against day, also user should be able to filter by vehicle type using selector. The problem is when I create a dataset containing vehicle type, day and those two metrics, microstrategy returns empty dataset.
By default MicroStrategy uses inner join for your metrics.
Of course in your case no vehicle is a car and a bus too, so you need to tell MicroStrategy to do an outer joins for the two conditional metrics that you created.
To do so just go to Menu Data -> Report Data Options and change the Metric Join type for the report where you have these metrics.
You can also decide to change the default Join Type at database instance level, but I don't think this is really necessary if you have this problem only for these two metrics.
For more details you can also check TN11721: What are the settings to consider when performing an Outer Join between metrics in MicroStrategy Engine 9.x?

crossfilter filter does not apply on update data. Is it by design?

I am managing a large dateset using crossfilter in my recent project, in which I will need ability to change the data value (a bool). However after the value changed, the filter on this property does not filter out changed item. For instance I have large dataset whose data has a property of Boolean named as 'Ignore'; I create a dimension for this property to filer out the data have ignore= true. In app, user has a capability to change this value from false to true. after value changed true, clear filters and refilter the data on this dimension, I am still getting the data item which supposed being filterred out. Is it by design or there is way to around it?
From the API Docs and source it appears this behaviour is not supported.
https://github.com/square/crossfilter/wiki/API-Reference

How can I get results for a dimension (custom variables), where the value is not set?

I am using custom variables to track order ids. In order to aggregate analytics data into out data warehouse, I want to select a number of metrics with the custom variable as a dimension. However, if I do so, I will not get the entries where the variable is not set (E.g. sessions that didn't result in a sale). I need to get these as well.
Can I write a filter or segment that selects only the entries that doesn't have a particular custom variable? I have tried:
segment=dynamic::ga:customVarValue1==
But that doesn't seem to work (It gives no results back).
Basically I'm looking for the equivalent to where ga:customVarValue1 is null in sql.
In short, it's not possible to get the nullset data, as explained by a Google rep:
For some dimensions, GA uses the default value of (not set).
Custom Variable do not have a default value, so if a hit does not have a
custom variable associated with it, all the other dimensions in the query
are not added to the reports.
The original answer is a little confusing, but when you read between the lines it suggests that they throw out these "empty" values when they run their aggregates.
The "correct" approach, as he explains, is to set a default value for any row you want reported:
If you need to see the (not set) value, you could try sending a default
value for custom variables.
For example if you use visitor level custom vars to track member vs
non-member, you should always set non-member as a default for everybody;
then modify to member once they register.
Details are here: http://groups.google.com/group/google-analytics-data-export-api/browse_thread/thread/cd078ddb26ca18d5?pli=1
I've just had some success solving this by using a Regex to capture users or sessions where the custom dimension has no value. In my case I want to separate logged in and logged out users.
The Regex .+ will capture any non-empty value, so can be used to get the job done.
The filters for my Returning users segment is matches regex: .+ like this:
For the Customer prospects I used: does not match regex: .+ like this:
It's early days, but this appears to be working:

Resources