Solved

Google Analytics Exclude Cookie does not appear to be working

Posted on 2013-06-22
2
226 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
2 Comments
 
LVL 16

Accepted Solution

by:
hankknight earned 250 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
A great marketing strategy is diverse.  Read about the not so popular, yet effective, marketing tactics you can start using today!
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now