Solved

Google Analytics Exclude Cookie does not appear to be working

Posted on 2013-06-22
2
224 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
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Read about how to approach blogging and about ways to do it right. Stand out from the crowd and let your knowledge be consumed by a large audience. This article aims to explain how your blog should look like,  the most important things to do while b…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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)
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

762 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

8 Experts available now in Live!

Get 1:1 Help Now