I want to create user_id
in GA4 which was linked to BigQuery.
I followed this document:
GTM to manage GA4.
GA4 links to BigQuery.
(Now I got data from my website, and data can collect in BigQuery.)
Passed user_id
to dataLayer
:
I've added the following script in HEADER
which above gtm.js
.
I'm not sure whether using a string (USER_ID
) as input at this step will affect the result or not.
<script>
dataLayer.push({
'user_id': 'USER_ID'
});
</script>
Create variable of dataLayer:
Adjust GTM code:
I expected that I build comparision like:
However, I cannot do that:
I expected my BigQuery can get a new column user_id
(no happen)
user_id
passed from the front-end and back-end be passed to BigQuery as I expected?From your process 5
The key should be user_id
Not userId
. It's different for GA4.
Follow the document