Custom dimension vs custom metric - google-analytics

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.

Related

GA4 Custom Dimensions (not set)

I added a custom parameter to my transactions. I am receiving data as when I go to Reports> Realtime>View user snapshot and click on an event I can see the parameter name and a value which is good. I can also see the value when I go to Reports>Engagement>Events and chose and event and select my parameter in the 'Events in last 30 minutes tab'. The issue comes when I go to Explore and make a Free Form with my parameter as a row or column as the column would simply show '(not set)' even though I know it is set from the before views that I mentioned
Thank you
You will see a value of “not set” for a custom dimension during the first 48 hours after you create the custom dimension.

Google Analytics: Unable to use a custom dimension as a secondary dimension in reports

We track search terms (e.g. michael kors handbags) entered on our site as an event (i.e. captured in eventLabel). We have a custom dimension that parse the list of product ids returned on a search page.
Example:
'michael kors handbag' returned 5 products on search page. Custom Dimension 1 parses a list of product ids: '12345, 23456, 34567, 45678, 56789'. On an event report, when I use this custom dimension 1 as a secondary dimension, no data is returned. I am seeing the two tags fired (i.e. one as an event hit and the other as a pageview hit) - I am not able to figure out why the custom dimension 1 cannot be used as a secondary dimension.
Any insight is helpful.
Thank you.
The dimension needs to be scoped at Session level, so it's available for all the hits within a session.
Probably the dimension is set at hit level, so the information doesn't persist, when you try to relate it to the event, GA cannot do it.

Google.Analytics. Make a report on url parameters values

Is it possible to make a report, where lines of the table will be different url parameter values and other columns - say ecommerce (transactions, CR)?
There is no out of the box report.
To do that you would need to:
create custom dimensions in the property settings (you only have 20). Let's say you name them imaginatively parameter1 - parameter20
user filters to map the query parameter (lets say param1-param20) to the custom dimension.
create a custom report for your custom dimensions
Go to filters, custom, advanced. Set Field A First field Request URI. In the Extract A field you enter (for a GET parameter "param1") the expression param1=([^&.]*). This stores the value for param1 in a variable called $A1. Leave Field B and Extract B empty.
In "Output to" select the name of your custom dimension, in this case "parameter1". In Constructor enter $A1. This will map the value extracted from the parameter to your custom dimension.
Other options: Field A required "Yes", Field B required "No", Override Output Field "Yes", case sensitive "No".
Now wait a while until data has been collected. Then go to "customization", create a new custom report, select parameter1 (or any other of your custom dimensions) as dimension and add metrics at your gusto. The report will only show data for pageview where the dimension has been set.
You would probably create your custom dimensions at hit level (unless you are only interested in the last value in a user session), so combining them with conversion metrics like transactions might produce not particulary valid results.
If you have more than 20 different url parameters you want to capture you are out of luck.
(Btw. I'm not actually sure this is a on-topic question, but the answer has an regular expression in it so it might count. Still reporting questions are probably better suited for webmasters.stackexchange.org).

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:

Views 1: Filter by custom table/field (or using Argument Hand. Code)

I have a page which should list nodes. The views is called from a locality page (a taxonomy term page). What I need is almost the same as using the Taxonomy: tid in arguments and passing the tid.
I can't use the term_node table, as (for other reasons) we have a custom table term_node_hierarchy (with nid and tid only). The table term_node_hierarchy is like term_node but also saves the tid of the parents (from an "external" code)
I've been looking for options but still no joy.
Currently I'm building an array of the nid's that should be displayed on the current page, and passing them like print views_build_view('embed', $view, $matching_nids); but the Argument Node: ID states This argument is a single Node ID. As said, only the first node is displayed when printing the views. It would be great if it could filter on more than one nid.
I'm open to any kind of suggestions on how to do this.
Thanks
You could create your own module for this. You could populate the $page_content variable with the results of your own custom query where you allow the user to sort against multiple nids. You could do this a number of different ways. You could display a list of the existing nids with corresponding checkboxes, so that, when the user clicks submit, all the nids that match the selected checkboxes get used in the query. Then you just display the result of that query. That's the easiest way I can think of to offer that degree of flexibility.

Resources