Custom Dimensions within Custom Dimensions in Google Analytics - multidimensional-array

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).

Related

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.

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).

Using Google Analytics how can I track different audience segments viewing the same page?

I'm looking for some general advice. The site I'm currently working on is full of duplicate content that's about to be deduplicated. But it was built that way to track different audiences visiting the pages by reporting on the URL hits.
Current Links
www.MySite.com/homeowner/painting
www.MySite.com/professional/painting
www.MySite.com/designer/painting
My concern is that at the end of the day, the person managing the analytics wants to be able to look at their report and say "We had X number of professionals visit the site." Simply deduping will elimate that.
I'm thinking Google Analytics might have a way to pass audience/tags in via the URL like this:
Example Links with Tracking
www.MySite.com/painting?tag=homeowner
www.MySite.com/painting?tag=professional
www.MySite.com/painting?tag=designer
Is this possible with Google Analytics? Does anyone have an example website using this?
I've looked into Custom Dimensions and Metrics but they seem to be overkill https://developers.google.com/analytics/devguides/collection/analyticsjs/custom-dims-mets
Custom Dimensions are not overkill, it's a reasonable idea for you to use them (because segmentation is what they are for, really).
Using a url tag has a couple of disadvantages. For one The tagged pages will appear as three distinct rows in your reports - you will be unable to get an aggregated number for www.MySite.com/painting, instead you will have three Urls (or as many as you have parameters).
Secondly, homeowner etc. are attributes that belong to a session, or even a user (if the role cannot change from visit to visit). However if you track them via url parameters they have only a hit level scope, i.e. they are recorded as a property of the viewed page, not the viewing visitor. If you record this as a session scoped variabe you need to set it only at the first pageview, and the value will be applied to all subsequent pageviews for that session.
So an easy way (example assumes you are using php) might be to use
if(isset($_GET['tag']) {
ga('send', 'pageview', {
'dimension1': "<?php echo filter_input(INPUT_GET, 'tag', FILTER_SANITIZE_ENCODED); ?>"
});
} else {
ga('send', 'pageview');
}
in your tracking code after you have created a session scoped custom dimension in your property settings ("dimension1" referring to the first custom dimension in your account, the numeric index changes for each dimension. The dimension name is only used in the reports, not the tracking code). You need to be careful not to send an empty value when the query string is not present - a session scoped custom dimension only records the last value from a session, if you send empty values you overwrite the value you recorded at the first pageview.
Alternatively you can do this without changing the tracking code at all - create a custom advanced filter to capture the value from the query string, a second to copy the value to your custom dimension and a third to remove the query string from the url. However while that's a neat trick using code is much easier.

Need to find out a drop offs from purchasing per type of user

My client need to find out a drop offs in purchasing process per type of user and per type of industry.
FYI- these both user type and industry type need to select the user while registring to the website. And user can see the products only once they loggedin.
So, what needs to be done for achieving this to track in google dashboard
thanks
On Login set the user type and industry as session scoped custom dimensions. Go to your analytics account, property settings, custom definitions, create a custom dimension, set scope to session (that way you need it to set only once per session, with a hit based dimension you'd need to send this with every pageview).
On your login confirmation page add the custom dimension:
ga('send', 'pageview', {
'dimension1': 'usertype',
'dimension2': 'industry',
});
Custom dimensions are specified as key/value pairs; the key is he string "dimensions" plus the numeric index of the dimension, the values you'd have to extract from your backend for each user when he logs in. It takes at least 24 hours until values for custom dimensions show up (well, at least for me).
Based on those custom dimensions you can create segments in the Analytics interface and do any analysis you like. You should probably create a goal with a funnel for your sales, and then apply the segment to the funnel view (or the goal flow view) to see where users drop of.

Using Google Analytics API, is it possible to filter on a dimension and a custom variable at the same time?

I have a webapp that hosts several thousand subdomain sites under a single Google Analytics property. I'm in the process of upgrading my tracking tags from the old ga.js system to the new analytics.js-based system (Universal Analytics).
In my old setup, when the tracking code got instantiated, I would send a site id to GA as a custom variable. Then, when pulling analytics for my users, I would simply filter on site ID as follows:
https://www.googleapis.com/analytics/v3/data/ga?
ids=ga:76149262&
start-date=2015-01-18&
end-date=2015-01-20&
metrics=ga:visits,ga:pageviews,ga:uniquePageviews,ga:pageviewsPerVisit,ga:bounces&dimensions=ga:date&
filters=ga:customVarValue1==f6853365a940330037c3aceff36de412&
max-results=100
In the new Universal Analytics system, there are no custom variables, as these have been replaced by dimensions. No problem. I've created a new dimension called siteHash and I've been submitting it along with each page request. What's more, I'm able to query this with only one tiny modification to my API request above:
https://www.googleapis.com/analytics/v3/data/ga?
ids=ga:76149262&
start-date=2015-01-18&
end-date=2015-01-20&
metrics=ga:visits,ga:pageviews,ga:uniquePageviews,ga:pageviewsPerVisit,ga:bounces&dimensions=ga:date&
filters=ga:dimension1==f6853365a940330037c3aceff36de412&
max-results=100
As you can see, I've just changed ga:customVarValue1 to ga:dimension1, and everything works.
Here's the issue: Once I push this code change to production, a lot of my sites will start to have a mixture of old data and new data. The old data will be tagged with the custom variable and the new data will be tagged with the new dimension. How can I query on both ga:dimension1 and ga:customVarValue1 at the same time within the same query?
I've tried creating an "OR" query as described here: https://developers.google.com/analytics/devguides/reporting/core/v3/reference#OR
This yields a filter parameter that looks like this:
ga:dimension1==f6853365a940330037c3aceff36de412,ga:customVarValue1==f6853365a940330037c3aceff36de412
Unfortunately, doing an API request with this filter yields no data. Does anyone know why? Is there a prohibition on filtering on dimensions and custom variables at the same time?
Assuming this is, for some reason, impossible. Is there any way to convert already collected custom variable data into dimension data? If I were able to do this, I could just query the API and only filter on dimensions since all of the old custom variable data would now be dimension data.

Resources