I want to set up GA4 for the test and production web page. (GTM code is not implemented yet)
In GTM, I have already set up the new environment for UAT,
2 constant variables = measurement ID (Live and UAT),
lookup table with both constant variables
and 2 Config tags (Live and UAT).
This means that both source codes (Live and UAT) have the same GTM code, but each Config tag should have its own Measurement ID from GA4 - one for Live and one for UAT.
There should 2 different properties (and not data streams right?) set in GA4 (one for Live and one for UAT). I want to avoid duplication of data.
I would like to know if this procedure is correct. I found many articles but most of them are not clear or for GA3.
Thank you.
There are many ways to implement it and I prefer using custom JS rather than lookup tables, but, yes, your actions seem to be proper. And yes, you don't use the stream ids (just a number), you use the alphanumerical value called Measurement ID. It's in the web stream details. Google made it really awkward to find and search by in GA4. In fact, you can't search by that ID in GA4 anymore, unfortunately.
Also, You may want to consider what you use as an input variable in your LUT. Most just use the hostname, but it may be a good idea to add the Environment Name and the Debug Mode variables to the mix.