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

19 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. A wired network has some disadvantages when compared to a wireless network, but wireless network is more convenient, especially laptop users, just sign in with password (what can be changed with 192.168.1.1)

    ReplyDelete
  4. Buy online wholesale printed custom cbd boxes and packaging at easy prices and shipping worldwide, with 24/7 customer support. Get a free custom quote now!!

    ReplyDelete
  5. Blackbird packaging provide you with any size, shape design, lipstick boxes sooner than any other packaging competitor in the market

    ReplyDelete
  6. Blackbird packaging provide you with any size, shape design, custom candle boxes sooner than any other packaging competitor in the market

    ReplyDelete
  7. Blackbird packaging provide you with any size, shape design, lipstick boxes sooner than any other packaging competitor in the market

    ReplyDelete
  8. 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
  9. Great Article
    Cloud Computing Projects




    Networking Projects



    Final Year

    Projects for CSE





    JavaScript Training in Chennai



    JavaScript

    Training in Chennai




    The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals,

    Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer.

    Angular Training

    ReplyDelete
  10. Blackbird packaging company can provide you with any size, shape design, and bath bomb packaging sooner than any other packaging competitor in the market

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

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

    ReplyDelete
  13. Shop from a vast range of variety of imported and local stock of prams and strollers online from Al-Fatah. Get your hands on the new wide range of prams, strollers, baby toddler strollers and baby prams from all the top brands. Avail Free Delivery on orders above 1000 PKR for selected cities in Pakistan.

    ReplyDelete
  14. Packaging town is a one stop solution for the short-run custom pillow boxes needs and supplies. At affordable prices. Request a free quote now.

    ReplyDelete
  15. buy microwave ovens online from Al-Fatah at best prices. Get free shipping

    ReplyDelete
  16. Blackbird packaging company can provide you with any size, shape design, and custom vape boxes sooner than any other packaging competitor in the market

    ReplyDelete
  17. 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
  18. Blackbird packaging provide you with any size, shape design, bath bomb boxes sooner than any other packaging competitor in the market

    ReplyDelete
  19. Packaging town is a one stop solution for the short-run custom pillow boxes needs and supplies. At affordable prices. Request a free quote now.

    ReplyDelete