Google Analytics Query Explorer - Custom Metric (alias) - google-analytics

Is it possible to have alias for custom defined metric in Google Analytics Query Explorer?
Currently I get table column name: Custom Metric 1 Value.

The Google Analytics Query explorer is mainly a development testing tool. It returns the information directly from the Google Analytics API, using the raw dimension and metric names.
The correct name via the API for custom metrics is GA:metric1 - ga:metric20 or Custom Metric 1 - Custom Metric 20.
You cant change that to make or make an alias.
If you want to do something like that you would have to code it directly yourself using the Google Analytics reporting api

Related

Retrieving user_pseudo_id from GA4 api

Is there a way to retrieve the user_pseudo_id field from GA4 api? It is not present in the dimensions list of the documentation but neither was the clientId for UA although it could be specified as a dimension.
See reference for clientID parameter in the older GA-UA APIs.
I need to retrieve historical data from GA4 and import them into Google BigQuery but not all export's fields are present in the GA4 api.
You will need to pass it as a custom user parameter via Google Tag Manager. Just need to set it once and then the rest of your GA4 tags will inherit it. Here’s a pretty good tutorial on how to do this: https://www.simoahava.com/gtmtips/write-client-id-other-gtag-fields-datalayer/

get CTR or clicks/Impressions via sisense from google analytics

I have CTR, clicks in the Google analytics. I want to get these data via sisense. According to the instruction https://documentation.sisense.com/7-1/managing-data/connectors/google-analytics.htm#gsc.tab=0 I use elastiCube manager to create an ElastiCube. I use google analitics web service to add the data to ElasiCube. I got 27 tables with names like: Traffic By Navigation, Monthly Report, Traffic By Navigation, Monthly Report and so on. By they do not have the fields which I need. I go to google analitics account via Behavior->Events->Overview. I can see "Clicks". How can I get it via sisense?
Here you can find an example for adding event fields with XML: https://support.sisense.com/hc/en-us/community/posts/115007407787-Tracking-Sisense-Usage-Via-Google-Analytics

Issue with integrating GTM Lookup Tables for multi-environment setup

I have been working on integrating GTM and GA to my website, using Environment Variables to setup GA Property Views for different setups.
I found similar solutions in various blogs, i.e., by setting up Lookup Tables or RegEx Table, with lookups for GA-Tracking-ID.
ISSUE
Lookup Tables adds a prefix vtp_ to the keys present in default GA-settings obj, as shown below:
Due to this, GA doesn't work.
If I use the GA Settings Variable directly, Everything works fine.
This happens on current Dashboard Setups for GTM and GA.
You cannot use a Google Analytics Settings variable as the output of a Lookup Table variable for a simple reason:
The "Google Analytics Settings" field in a tag is the only place where you can use a Google Analytics Settings variable, and it is the only type of variable you can use there.
In other words, if you create a Lookup Table variable that returns Google Analytics Settings variables, there's no place to add that variable to, since the only valid place would be the Google Analytics Settings field which, as noted above, doesn't accept Lookup Table variables.
Trying to add the Lookup Table into the "Tracking ID" field, for example, is a mistake, since the table returns a Google Analytics Settings object rather than a valid tracking ID.
i had the same issue, and i was mapping the lookup values to variables of type google analytics settings:
i changed them to strings then it started working:
Here's how I did it successfully with Dev and Live environments setup.
Enable Environment Name in Built-In Variables
Create a Lookup Table variable in User-Defined Variables as GA Tracking ID - ENV
For the Lookup Table row, change it accordingly. In my case, my environments are only Dev and Live so I put it there.
Create a Google Analytics Settings variable in User-Defined Variables
For the Track ID, select the GA Tracking ID - ENV - that's all the variable config for this to work in minimum.
Then Create a Tag for the Google Analytics
Make sure to select the Google Analytics Settings created.

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.

Are variables passed in a URL tracked by Google Analytics

From what I understand, the data passed in POSTs from a form on a site is not tracked by Google Analytics. What about any variables that get passed in the URL, as in ?value=bla
Does value=bla get stored by GA?
If so, is there a way to not track variable info from the URL?
I am aware of the anonymizeIp for IPs.
GA profile settings have a text field where you can enter query parameters that should be ignored. You can also set up an advanced filter to summarily excludes all query parameters (simply google "exclude query parameters google analytics", there a lot of tutorials on how th do this).

Resources