Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6564771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:00:34+00:00 2026-05-25T14:00:34+00:00

I got the cookie method of excluding my traffic to work when I didn’t

  • 0

I got the cookie method of excluding my traffic to work when I didn’t specify the domain. Now that I have specified the domain, it no longer works. It appears to be setting two cookies, the exclude.html page I created is setting a cookie of “mydomain.com” and the google analytics is setting a cookie of “www.mydomain.com”.

Here is the code for my exclude.html page.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Exclude Me</title>
    <script type="text/javascript">

        var _gaq = _gaq || [];
        _gaq.push(['_setVar', 'exclude_me']);
        _gaq.push(['_setDomainName', 'www.mydomain.com']);
        _gaq.push(['_setAccount', 'UA-xxxxxxxx-x']);
        _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);
    })();

    </script>
</head>
<body>
    <p>
        This computer now has a cookie placed on it to exclude it from any Google Analytics reports.</p>
    <p>
        If you delete your cookies, you will need to revisit/reload this page again.</p>
</body>
</html>

I added the _gaq.push(['_setDomainName', 'www.mydomain.com']); to try and get it to work which doesn’t appear to be doing anything. That is the way I have it setup for all the other pages, using the http://www.mydomain.com.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:00:34+00:00Added an answer on May 25, 2026 at 2:00 pm

    As I was typing this it appeared to me that the ‘_gaq.push([‘_setDomainName’, ‘www.mydomain.com’]);’ should probably be put in before ‘_gaq.push([‘_setVar’, ‘exclude_me’]);’ So I switched them around and it is no longer creating two different cookies, so hopefully that works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our server got hacked via some SQL Injection method (now patched). All our PHP
I have got a cookie string from HTTP response header like the following line:
I've got my php working to set a cookie storing the http_referer the visitor
I've got a user log in form which sets a cookie and enables members
I've got a web system where users log in, and it stores a cookie
UPDATE: SOLVED Hi all, i've got it, just save cookie to temp file, and
Got a bit of a confusing situation, I have a form on my webpage
Got a bluescreen in windows while cloning a mercurial repository. After reboot, I now
I have a dijit.Tree that's populated by a ItemFileReadStore using JSON. Because of our
I have got the following code to show a dialog box when the image

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.