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 8737307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:29:26+00:00 2026-06-13T10:29:26+00:00

When I place the following code on my site for a nice standard +1

  • 0

When I place the following code on my site for a nice standard +1

<!-- Place this tag where you want the +1 button to render. -->
<div class="g-plusone"></div>

<!-- Place this tag after the last +1 button tag. -->
<script type="text/javascript">
  window.___gcfg = {lang: 'nl'};

  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>

It does something I do not want.

Without this code I only have my own phpsessid which is needed to have my site functioning.

With this code the following cookies are dropped from the domain plusone.google.com

Google Plus one drops a lot of cookies!

Now, when looking at the expiration date, somewhere in 2014, 2022, 2013… they will live a very long long time.

Point is, nowhere is documentation readily accessible how to disable the placement of cookies by google+1 button, i’ve done my best to look, even read a lot of stack overflow posts in the hope to find something related.

I did however find how to disable cookies for analytics in my quest(hurray!) but now I need to find a way, javascript option or something to tell plusone not to drop cookies(long live dutch/european cookielaw)

The Question:
Has anyone ever encountered the documentation/option to tell +1 button not to drop cookies?

  • 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-06-13T10:29:27+00:00Added an answer on June 13, 2026 at 10:29 am

    I have coded up a permissions based workaround but I still find it far from ideal because I have to bug the user for permission when they click, but it’s better than nothing.

    I still need a way to stop google from dropping unwanted cookies. There is no need to track users with so many cookies or any cookies at all in my opinion.

    This code makes an user click the link, when they click it they get asked if they want to show the button and what the consequenses are of that descision.

    My example code: http://jsfiddle.net/CADjN/3/

    Live demo https://www.ortho.nl/orthomoleculaire-bibliotheek/artikel/8091/Langer-leven-met-vitamine-D

    <script type="text/javascript"> 
    // Function to set the cookie plusone.
    function setCookie()
        {
        domain = "www.mysite.com";
        c_name="plusone";
        value="yes";
        var exdate=new Date();
        exdate.setDate(exdate.getDate() + 365);
        var c_value=escape(value) + "; expires="+exdate.toUTCString()+';domain='+domain+';path=/';
        document.cookie=c_name + "=" + c_value;
        }
    // Function to see if our plusone cookie exists and has value yes
    // Returns true when the cookie is set, false if isn't set.
    function getCookie()
        {
        var i,x,y,ARRcookies=document.cookie.split(";");
        for (i=0;i<ARRcookies.length;i++)
            {
            x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
            y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
            x=x.replace(/^\s+|\s+$/g,"");
    
            if (x.indexOf("plusone") != -1)
                {
            if(unescape(y)=="yes")
            {
            return true;
            }
        else
            {
            return false;
            }
            }
        }
    }
    // Load the plusone module but first ask permission
    function loadplusone(thelink) 
        {   
        // Cookie hasn't been set
        if(!getCookie())
            {
                // Get permission
            if(window.confirm("If you wish to 'plusone' this page we need to load a special button from Google.com.\n\nWith this button Google will place some cookies on your computer. Google uses these cookies for statistics and maintaing your login status if you have logged in with Google.\n\nDo you consent to loading the button and the placement of cookies by Google?\n\nIf you agree this website will place a cookie with a year lifetime on your computer to remember this and the plusone button will be loaded on every page where the plusone button is present on this site."))
                {
                        // set cookie, load button
                setCookie();
                var jsnode = document.createElement('script');   
                jsnode.setAttribute('type','text/javascript');   
                jsnode.setAttribute('src','https://apis.google.com/js/plusone.js');   
                document.getElementsByTagName('head')[0].appendChild(jsnode);   
                document.getElementById(thelink).innerHTML = ''; 
                }
            }
        // cookie has already been set, just load button.
        else
            {
            var jsnode = document.createElement('script');   
            jsnode.setAttribute('type','text/javascript');   
            jsnode.setAttribute('src','https://apis.google.com/js/plusone.js');   
            document.getElementsByTagName('head')[0].appendChild(jsnode);   
            document.getElementById(thelink).innerHTML = ''; 
            }
        }
        </script>
        <!-- Where the plusone button should go this piece of code should be placed -->
        <a id="plus1" href="javascript:loadplusone('plus1')">Show Google +1</a><g:plusone></g:plusone>
        <!-- This should be placed below the above code or in the onload event of the document -->
        <script type="text/javascript">
        if(getCookie())
            {
            var jsnode = document.createElement('script');   
            jsnode.setAttribute('type','text/javascript');   
            jsnode.setAttribute('src','https://apis.google.com/js/plusone.js');   
            document.getElementsByTagName('head')[0].appendChild(jsnode);   
            document.getElementById('plus1').innerHTML = ''; 
            }
        </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I added following standard Google Plus One code to my web site. <!-- Place
I have the following code generating content on my site: <div class=content id=links> <?php
I am working on a WordPress site and I have placed the following code
Im using the following code to place an object inside a container: testParent =
So, I'm finishing up an iPhone App. I have the following code in place
I'm test building a scraping site with django. For some reason the following code
I have the following code in my application: $(.deleteproduct).click(function() { id = this.id; alert(id:
I received this code from one of those nice people here who are willing
When a user log into my asp.net site I use the following code: FormsAuthentication.RedirectFromLoginPage(userid,
Hello I have a wordpress site than I want to upgrade to HTML5 code

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.