?
Solved

Google Analytics Exclude Cookie does not appear to be working

Posted on 2013-06-22
2
Medium Priority
?
234 Views
Last Modified: 2016-02-24
I've tried to exclude visits from my own website in Google Analytics, but it appears not to be working.  Please advise.  I'll embed the contents of my exclude cookie, and screenshots of my Google Analytics filter settings and the traffic report about visits from my website.
Analytics-Exclude-Cookie.htmlFilter-settings.jpgVisits-from-my-website-reported-.jpg
0
Comment
Question by:ddantes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 16

Accepted Solution

by:
hankknight earned 1000 total points
ID: 39269722
If you don't mind being invisible to Google Analytics for ALL websites, not just yours, consider this plugin:
https://tools.google.com/dlpage/gaoptout
or consider adding a hosts file entry:
http://www.ccsf.edu/Policy/Privacy/ga.html

The reason that your approach is not working is because of a race condition.  
<body onload="javascript:__utmSetVar('no_report')">

Open in new window


That code is not executed until everything else is fully loaded, including the Google Analytics.  So because you are running that code LAST it is useless.

Consider something more like this:
  var BockMe=0;

  if(1==1) BockMe=1; // If you want this to be blocked BockMe=1;
  
  var _gaq = _gaq || [];
  if(BockMe!=1) {
   _gaq.push(['_setAccount', 'UA-XXXXX-Y']);
   _gaq.push(['_trackPageview']);
   (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
   })();
  }

Open in new window

0
 

Author Closing Comment

by:ddantes
ID: 39282421
Thank you.  I'll refer to this answer if the problem persists, but I think it has been resolved.  Some time ago,  I needed to delete all the cookies on my desktop, and I didn't realize that I needed to visit the exclusion cookie web page on my server in order to "reset" the exclusion.  Having revisited that page, there are no further visits reported in Analytics.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
There are many other benefits to creating an inbound marketing strategy. Let’s take a look at five of the biggest and how they'll affect your business.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question