Can I set custom metrics with Google Tag Manager? - google-tag-manager

I have a basic yet complicated question. I'm trying to create a custom metric to count number of new memberships. Can I do it with Google Tag Manager?
Thanks for the help.

To create a custom metric with total new memberships:
Create a custom metric, with a scope of hit, and formatting type of integer. Make a note of what index this custom metric is (e.g. 1).
Create an event in Google Tag Manager, which triggers on the creation of a new account. In settings for the event, go to More Settings -> Custom Metrics -> and click ADD CUSTOM METRIC.
In index, insert the index value given by Google Analytics when you set up the custom dimension (in this case 1), and set the metric value to 1. This would allow for you to aggregate in custom dimension 1, the total number of new memberships.
Its probably more relevant to set this up as a goal however, as this will give you conversion rates, and all the other added benefits.

Related

Custom Dimensions within Custom Dimensions in Google Analytics

Within the unpaid version of Google Analytics, you are limited to 20 custom dimensions per property/view. As a workaround, I am currently attempting to create a custom dimension table within the existing custom dimensions in Google Analytics. In essence, I am trying to use an index and value custom dimension as a custom dimension table within itself. The problem that I am trying to solve is with a 6sense GA integration, currently, 6sense takes up 17 out of the 20 available custom dimensions. I want to consolidate these 17 custom dimensions into a lookup table variable that is pulling from the 6sense companyData variable in the dataLayer: 6sense Lookup Table Variable
The problems that I am running into are this:
Once I have this configured how do I access each of these indexed values in GA?
As it is configured, would it still allow for granular Session data (Session, Bounce Rate, Goal Completions, etc.)?
Any ideas, help, suggestions are all appreciated. Thanks in advance!
The value of the custom dimension is a string, you cannot use it as a lookup. The way you are trying it won't work, because if for example the dimension is at the session or user level, the next value will replace the previous one within that session, therefore you would lose all the previous values and the last one sent to that index would 'win' and it will be the value of that custom dimension of the session.
An alternative solution could be to create a string with the information of interest concatenated and send it in a custom dimension (always considering that if this string changes, the one sent as last to Analytics in the session is saved, for session and user level hits).

Google Analytics - Change old data using import feature for custom dimension used in a view filter

We have a custom dimension for "Product Category Code" and a views that are based on filtering different values for Product Category Code. If the code changes for some reason , we are thinking of using the data import feature to update the custom dimension retroactively. During the test , we notice that the custom dimension values are being refreshed after using Query time processing . However it does not sounds like we are able to apply the change in views retroactively though. Is there any way the change in value can be applied in view filter ?
Google analytics records the data you send to it and processes that. Once the data has been sent it is set in stone there is no way to change it.

user_id as custom dimension not passing to GA

I've created a custom dimension to pass the user-_id (a shopify customer id) to a custom report in GA, however it's not populating. Steps I've taken:
1. Defined custom dimension in GA called "User ID" with scope User
2. Configured in Tag Manager in page view tag, a new variable to capture the user_id from the data layer.
Following is a screenshot from the Tag manager assistant:
Creating a custom report with this new dimension and other metrics
Any idea why it's not passing the data?
You have to send the value to Google Analytics as custom dimension.
So, you have to add the index of the custom dimension and its value in 'Custom Dimensions' field in the Google Analytics tags or its shared settings variable:

What is the best way to neglect undefined variables in GTM , Where the data is not availble .

I have implemented GTM and GA with event based tracking. Alongside events tracking I have implemented custom dimensions and Custom Variables. In all the pages All defined Custom metrics and dimensions are populated according to needs , which is giving empty data in some cases.
for Ex. When user Registers on our page their Registration will be added to data layer object for custom dimensions but this info is not available on every part of the website..
Kindly help and suggest what to do . Do I need to create several tags for specific conditions or track the issues with develops where they can give custom info when the data is not available .
If you pass in an "undefined" value to a custom dimension or metric then Google Analytics will just treat it as if the dimension or metric was not set at all. I.e. you will not have "undefined" in your reports, but no value at all. So you could just ignore the issue.
As an alternative you could set a default value that is used when no other value is available (i.e. for filtering).

Google Analytics - Using Client ID as a custom dimension

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

Resources