I'm using the Reporting API v4 and collecting information about Custom Dimensions.
https://developers.google.com/analytics/devguides/reporting/core/dimsmets#view=detail&group=custom_variables_or_columns&jump=ga_dimensionxx
I am able to get dimensions like ga:dateHour but am unable to find a dimension that I can receive the "name". I want to pull in the names "zcode" and "ztest"
described in this picture Custom Dimensions
Am I missing a dimension or metric in this API to achieve this?
Thanks!
The name is used in the reporting interface only. In the API you address custom dimensions by the keyword "dimension" followed by their respective numeric index.
So in your example you would retrieve values for "zcode" by querying "dimension1".
Related
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).
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.
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).
I created a custom object and i want to get all its existing records. Is there a way of doing that via the REST API? Seems like a very basic and simple operation but i couldn't find information about it anywhere.
As you say, it seems like a basic task, but in the reality, it is more complex indeed.
Unfortunately, the Get Custom Object endpoint (which is the only endpoint to fetch Custom Objects) requires the filterType and filterValues parameters to be present as well. Basically this means that you have to have some information about the queried objects beforehand.
Also, a further restriction is that the value of filterType can only be one of the “searchable” fields of the Custom Object, meaning that it has to be either a Link field or a Dedupe field. (These fields are listed under the searchableFields property in the response from the Describe Custom Objects endpoint.)
So as mentioned above, you have to know the values for at least one of the properties of your Custom Objects before you make the query.
With additional queries though, you can grab these required values.
Let's say, you have your Custom Object linked to the Lead Object, and the Link field is called Owner Email (with the REST API name being ownerEmail) which links to the Email Address field of the Lead Object. In this case you could set the filterType to ownerEmail and set the emails of the leads as filterValues.
Then it is up to you how you gather the emails of those Leads who has a Custom Object attached. Luckily the REST API won’t throw an error if you provide a value that has no corresponding Custom Objects.
If your Custom Object is linked to a Lead, it's a bit complex but you can do like this:
Create a smart list and filter with "Has You Custom Object"
Get the smart list with API (GET /rest/asset/v1/smartLists.json)
Based on this list of Leads, get all Custom Objects (see the other answer).
I want to query the google analytics realtime api using one of my custom dimensions.
In the regular api (not realtime) I can do this as follows:
'metrics': 'ga:pageviews',
'filters': 'ga:pagePath=~/myPath*;ga:dimension2=='+myVal
However, when I change the metrics to 'rt:activeUsers', I got the error:
"Unknown dimension(s): ga:dimension2"
when I did the request.
I changed the separator in the filters string from semi-colon to & and I didn't get the error any more, but the result always returns 0
Is it possible to do filtering on the realtime api? TIA
The realtime API does not support custom dimensions (you can see the list of supported dimensions and metrics here). On possible reason is that at least the values for session- and user-scope dimensions cannot be determined in realtime since realtime reports based on hits. So you cannot filter based on a custom dimension.
There is a possible workaround, but that comes with a caveat that makes it mostly pointless. You can create an additional data view, and then use an advanced filter to copy the custom dimension value for the hit to a dimension supported by the realtime API - e.g. you extract the value from your custom dimension and copy it to the "source" field (or some other field). Then you query for/ filte by the source field to retrieve the value. The caveat is that the original value of the source data field (or whatever field you overwrote) will be lost.