Anyone know the process for using a GA live UA code to test a site in development. I.e. I have a live site with a GA UA code attached, tracking live traffic data etc e.g. UA-123456.

I've been told that there is a way to produce another code associated to the primary code to use on the testing version of my live site e.g. test code could be UA-123457.

Can anyone shed some light on this?

If not possible should I just set up a completely separate GA account for my testing site?

  • Is the development site at the same domain as the main one?
    – Nick
    Commented Sep 12, 2012 at 10:02
  • Hi Nick - No both are on stand alone domains.
    – Drew
    Commented Sep 13, 2012 at 0:15

1 Answer 1


There are a couple of ways you could achieve this, depending on how your test/dev site is set up.

You could use a completely separate GA account and UA code - one of the risks with this is that you forget to change the code when you eventually deploy the site (or forget to change it again after some further changes in the future).

The other option is to create an additional profile within your "live" account. In that profile, add a filter that includes just the data from your test site.

You then need to make sure you exclude your test data from your "live" profile.

Presuming your test/dev site is on another (sub) domain, then the following filter in a new profile would work:

  1. From "Home" click on "Admin"
  2. Click on "filters"
  3. Click on "New filter"
  4. Make sure "Create new filter" is selected.
  5. Name your filter something useful such as "Test/Dev"
  6. Select "Custom Filter"
  7. Select "Include"
  8. In the "Filter Field" drop down, select "Hostname"
  9. If your dev site is, say, beta.beantin.se, you should put "beta.beantin.se" (without the quotes) as the filter pattern.
  10. Make sure "No" for case-sensitive is selected.
  11. Save your filter!
  • Thanks for this - Beantin. I'll give it a crack and see how we go.
    – Drew
    Commented Sep 13, 2012 at 8:08
  • Great! Glad to have helped.
    – Beantin
    Commented Sep 16, 2012 at 13:02
  • It can also make sense to exclude traffic from certain IP addresses, like your corporate network. That way, you only get the "real" customers.
    – nmit026
    Commented Sep 27, 2017 at 4:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.