Solved

Google Analytics Exclude Cookie does not appear to be working

Posted on 2013-06-22
2
227 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
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 code hide show and toggles. 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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

776 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