Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google analytics account vs property

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?

like image 643
robert Avatar asked Sep 01 '25 10:09

robert


1 Answers

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:

  1. All Web Site Data (the default, which tracks everything)
  2. Test (test.somethinghere.com)
  3. Production (somethinghere.com)

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.

like image 51
Philip Walton Avatar answered Sep 04 '25 00:09

Philip Walton