I have production site (for example, somethinghere.com) and test site (test.somethinghere.com). I want to separate GA tracking for these environments. Should I create one account and two properties (one for prod. env. and second for test env.) or better to use two accounts. Essentially in both cases traffic will be separated. What would be better approach?
You definitely don't need two accounts. Arguably, you don't even need two properties. You could install the same tracking code on your prod and test sites and create separate views to filter out hits based on the URL.
Using this strategy you'd end up with three views:
The advantage of doing it this way is if you ever need to report on test + prod data, you can easily do it with the default view. The other views work as normal.
Another advantage is you won't need different code for test vs. prod environments. What if your test environment all checks out and then suddenly no hits come through in prod? How will you know what went wrong? If your GA code is the same in both cases you can be more confident that when you push to production your analytics will be tracked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With