Retrieving user_pseudo_id from GA4 api - google-analytics

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/

Related

Firebase A/B test user variant information not available in Google Analytics clickstream tables

I'm looking to report on the outcome of a Firebase A/B test using Google Analytics / BigQuery tables.
To do this I need to identify the test group each user was in.
The Firebase documentation (https://firebase.google.com/docs/ab-testing/ab-concepts) suggests experiment and variant memberships are stored as user properties on every GA event in the normal GA event tables.
However, I can't find this information associated with GA events in the GA interface or BQ clickstream tables - I can only see it in the Firebase tables.
Where should I be looking? I've checked the Event Action, Event Category, Event Label etc. dimensions.
Use in your query to identify it
userProperty.value.string_value where userProperty.key = 'firebase_exp_000'

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

GA realtime api with custom dimensions

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.

Google Analytics Query Explorer - Custom Metric (alias)

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

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