I'm using Google-Analytics on my pages. Quite cool tool. But one thing is buging me: Because I don't wanna log my own access, how can I disable the analytics-script when I'm calling pages from within my own network?
One idea was to call the website using an different url preffix like "intern.mywebpage.de" instead of "www.mywebpage.de". Now I could write an XSLT that checks the address and inserts the script only on calls for "www...". But this looks like a quite big overhead on each page-call.
@Arnim - I think the easiest thing to do is to use the Google Analytics exclusion cookie - just create a simple content page in your site with the cookie-setting-code, publish it, visit it (which sets the cookie for you) then just unpublish or delete the content page. Keep in mind that if you use software to clean out your cookies, you should set it to exclude this special cookie.
@Petr: you don't turn G-A off, just the statistics reporting from the machine with the /etc/hosts entry. That might be the only rub; Arnim will have to do this to every machine inside his network. BUT -- no need to modify code -- it's what we do, and the helps diminish pushing data out from our network.
1. Login to your Google Analytics Account 2. Select the profile you want to work on and click “edit” 3. Go to the third gray box named “Filters Applied to Profile” 4. Click “Add Filter” on the top right 5. Select “Add new Filter for Profile” with the radio button 6. Give the Google Analytics filter a name (example: “exclude my own visits” 7. Select “Exclude traffic from an IP address” 8. Type in your IP address with a regular expression syntax, so you have to replace “.” with “\.” So if your IP address is: 123.456.789.012 then you need to type in: 123\.456\.789\.012 You can also use match types and wild cards. 9. Click “finish” and you’re done!
What happens now? Well - now all the NEW data Google Analytics collects will exclude your IP’s. Make no mistakes - if your IP has visited the web site in the past, it will still show, as Google Analytics Filters only affect the future.
Whew, Umbraco-Community proves again - thanx for all your anwers!
At the moment I'm using a small XSLT inside the MasterTemplate, guess it works fine. This solution also works perfect when I'm testing from at home or on the road. At least if I remember to use the correct subdomain everytime.
Disable Google-Analytics on local access
Hello,
I'm using Google-Analytics on my pages. Quite cool tool. But one thing is buging me: Because I don't wanna log my own access, how can I disable the analytics-script when I'm calling pages from within my own network?
One idea was to call the website using an different url preffix like "intern.mywebpage.de" instead of "www.mywebpage.de". Now I could write an XSLT that checks the address and inserts the script only on calls for "www...". But this looks like a quite big overhead on each page-call.
Is there a better way? Happy for any idea,
Arnim.
@Arnim - I think the easiest thing to do is to use the Google Analytics exclusion cookie - just create a simple content page in your site with the cookie-setting-code, publish it, visit it (which sets the cookie for you) then just unpublish or delete the content page. Keep in mind that if you use software to clean out your cookies, you should set it to exclude this special cookie.
For the Google Analytics exclude cookie code and other info, see this: http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55481
~Heather
I don't think a single simple macro like that would hurt you performance too bad.
Another way to go could be doing some inline scripting in your masterpage template, if you're using V4?
Or add to your /etc/hosts file:
# 127.0.0.1 ssl.google-analytics.com #[disabled = Firefox issues]
127.0.0.1 www.google-analytics.com #[Google Analytics]
127.0.0.1 4.afs.googleadservices.com
127.0.0.1 feedads.googleadservices.com
127.0.0.1 imageads.googleadservices.com
from the marvelous "MVP Hosts" file -- which adds a whole lot of other benefits: http://www.mvps.org/winhelp2002/hosts.htm
That will keep g-a from getting your information.
@Kyle: This way whole analytics are disabled, isn't it? Analytics backend and other sites statistics too.
@Petr: you don't turn G-A off, just the statistics reporting from the machine with the /etc/hosts entry. That might be the only rub; Arnim will have to do this to every machine inside his network. BUT -- no need to modify code -- it's what we do, and the helps diminish pushing data out from our network.
@Kyle: Yes, but it disable reporting for everysite, not only for his own site.
@Arnim: You can also check headerhost in javascript and choose if start ga tracking. But as Morten wrote this simple macro dosn't hurt performance.
Use the Google Analytics dashboard and disable your own ip for your site, step by step info from http://www.ophircohen.com/2008/04/24/google-analytics-filters-advanced-adwords-filter/:
1. Login to your Google Analytics Account
2. Select the profile you want to work on and click “edit”
3. Go to the third gray box named “Filters Applied to Profile”
4. Click “Add Filter” on the top right
5. Select “Add new Filter for Profile” with the radio button
6. Give the Google Analytics filter a name (example: “exclude my own visits”
7. Select “Exclude traffic from an IP address”
8. Type in your IP address with a regular expression syntax, so you have to replace “.” with “\.”
So if your IP address is: 123.456.789.012 then you need to type in: 123\.456\.789\.012
You can also use match types and wild cards.
9. Click “finish” and you’re done!
What happens now?
Well - now all the NEW data Google Analytics collects will exclude your IP’s. Make no mistakes - if your IP has visited the web site in the past, it will still show, as Google Analytics Filters only affect the future.
Whew, Umbraco-Community proves again - thanx for all your anwers!
At the moment I'm using a small XSLT inside the MasterTemplate, guess it works fine. This solution also works perfect when I'm testing from at home or on the road. At least if I remember to use the correct subdomain everytime.
Filter settings as shown by Tom seem also an quite perfect way as long as I'm testing from inside my local intranet.
@Tom: One Question, maybe you can help me out - which IP do I have to filter? My local Intranet-IP i.e. 192\.168\.* or my extern Internet-IP?
@Morten: I'm using (of course) V4, can you show me how inline-coding would look like?
Thanx again to all, quite interessing, to see what different aproaches are possible!
Greets, Arnim.
@Arnim Anhut: You should add your extern internet ip.
Arnim, I created some login features just by writing to templates. I use both server controls and create some methods.
http://www.mortenbock.dk/setting-up-membership-in-umbraco-116.htm
I think you can create a page_load method or something in there...
Something like:
<script language="C#" runat="server">
void Page_Load(object sender, EventArgs e){
Response.Write("1");
}
</script>
is working on a reply...