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
Solved

Google Analytics Exclude Cookie does not appear to be working

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Concerto Cloud Services, a provider of fully managed private, public and hybrid cloud solutions, announced today it was named to the 20 Coolest Cloud Infrastructure Vendors Of The 2017 Cloud  (http://www.concertocloud.com/about/in-the-news/2017/02/0…
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.

790 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