find a location for property in a new city

Wednesday 26 October 2011

Remote development and staging environments from Google Analytics

I have created a new site which is currently only getting a low amount of traffic. There is a beta version of the site live at the moment but it is still in development too. My problem is that Google Analytics is still tracking page views on my local machine during development because the Google Analytics tracking code is on the local version too.

I do not want any hits that are a result of me testing my development site or staging site to count towards the total page views and unique visits recorded in Google Analytics. Since there are only low amounts of traffic at the moment my development will dramatically skew the analytics results.

I tried a few ways to control the analytics recordings by using filters in the Google Analytics dashboard but made some mistakes which destroyed all tracking before I finally got it right. Whoops... So to make sure you get it right first time here is how to do it.

How to filter page views from your local or development site

  1. Go to you Google Analytics dashboard by clicking on "Analytics Settings"
  2. Click "Filter Manager »"
  3. Click "Add Filter"
  4. Name the filter
  5. Select the "Custom filter" radio button
  6. Select "Include" radio button
  7. Choose "Hostname" as your Filter Field
  8. And type in "^www\.mysite\.com$" as your Filter Pattern (without the quotes)
  9. Select case-sensitivity. I chose "No"
  10. Add your website profile to the selected website profiles
  11. Click "Save Changes" button
And you're done. This will stop any sites like local.www.mysite.com or 127.1.1.1 every affecting your analytics. It will only register when the host name is exactly www.mysite.com. I hope that helps you get it right first time so you don't accidentally take your analytics down like I did!

Follow britishdev on Twitter

26 comments:

  1. I read your blog and I am satisfied with your writing contents. It has a lot of tiny information which is really helpful to understand easily. Keep sharing more news. I read a lot of blog posts and I never heard of a topic like this. It is very interesting. I have visited affordable custom essay writing service in the field.

    ReplyDelete
  2. Motifz Designer Lawn. 1, 2 & 3 Piece Unstitched Premium Embroidered Lawn 2019, Premium embroidered Lawn, Premium lawn, Premium lawn 2019, Motifz, Premium lawn in Pakistan. Shipping worldwide. Stitching option available.

    ReplyDelete
  3. Packaging town is a one stop solution for the short-run cbd tincture boxesneeds and supplies. At affordable prices. Request a free quote now.

    ReplyDelete
  4. buy wholesale cbd bath bombs online from blackbird packaging at best prices. Get Free shipping

    ReplyDelete
  5. buy grocery online in pakistan from alfatah at best prices. Get free shipping

    ReplyDelete
  6. Wild Goat brings you Polo shirts online like you have never seen before. Prioritizing your style and comfort as well as preserving our national heritage. Wild Goat’s Polos will guarantee the perfect fit each time! Get your Polos now at a 20% off.

    ReplyDelete
  7. This is a great post. I like this topic.This site has lots of advantage.I found many interesting things from this site. It helps me in many ways.Thanks for posting this again. it's time to avail this Residential Roofers in Portland visit here for more details.

    ReplyDelete
  8. i read about development staging google analytics. it's very informative and have good stuff. keep up and thanks for this. it's time to avail this garage door repair windsor visit here for more details.

    ReplyDelete
  9. buy speed vest from dshred at best prices deliered at your doorstep. Get free shipping

    ReplyDelete
  10. I have been reading out many of your articles and i can claim pretty good stuff. I will make sure to bookmark your website, thanks. this time to take advantage of Air duct cleaning Services in Daly City visit for more details and get more services

    ReplyDelete
  11. I appreciate your efforts you provide the informative information about web development and google analytics. This post is very helpful for developers. Furthermore Commercial Interior Painting in Baltimore deliver good work related to house, offices, lobbies, restaurants and commercial areas.

    ReplyDelete
  12. Buy electronics online in Pakistan from alfatah at best prices delivered at your doorstep. Get free Shipping

    ReplyDelete
  13. Buy sports bra pakistan online from Dshred at easy prices delivered at your doorstep. Get free shipping

    ReplyDelete
  14. Buy jogger pants men from ndure at best prices delivered at your doorstep. Get free shipping

    ReplyDelete
  15. Buy lightweight vest online dshred at best prices delivered at your doorstep. Get free shipping

    ReplyDelete
  16. Buy lightweight vest from dshred at best prices delivered at your doorstep. Get free shipping

    ReplyDelete
  17. Buy shorts for men online from Ndure at best prices delivered at your doorstep. Get free shipping.

    ReplyDelete
  18. Buy women hand bag online from Al-Fatah at best prices delivered at your doorstep. Get free shipping

    ReplyDelete
  19. Good job Air Conditioning Installation Services Palm Desert CA to provide the energetic information to us. We can knows about the analytics and start to work on it.

    ReplyDelete
  20. You provide informative information related to development starting od google analytics in detail. This post is very helpful for me because I am a developer. Further, We provide theDistance moving in Springfield at a low price.

    ReplyDelete
  21. Borjan offers its customers the best slip on shoes for men online in Pakistan. We have the highest quality slip ons for men in Pakistan for the most affordable prices. Get Borjan's amazing collection of men's slip ons shoes online. Get your favorite shoes for men from Borjan to keep yourself in style and comfort at the same time.

    ReplyDelete
  22. Buy best latest fashion ladies 100% women cotton t shirts online from Ndure. Fast Shipping.

    ReplyDelete
  23. This is great. Seeking swedish writing help online, we offer top-quality writing help at affordable rates. Let us help you.

    ReplyDelete
  24. Wonderful. Keep sharing. I love them Are you also searching for accounting writing help? we are the best solution for you. We are best known for delivering dissertation assignment services to students without having to break the bank

    ReplyDelete