piwik_ignore cookie not working in 1.1


(pista73.com) #1

piwik_ignore cookie not blocking counter in version 1.1

regards,
PM
admin @ pista73.com


(Matthieu Aubry) #2

Can you please try to delete + set it again in the admin UI ? there might be a bug for when the cookie was set before 1.1


(vipsoft) #3

it’s not a bug. It’s a bug fix. You have to regenerate the ignore cookie from pre-1.1. I added a value to the cookie and signed it, to prevent abuse.


(Matthieu Aubry) #4

Anthon, I guess we should delete the cookie on update so at least the message does not say ‘the cookie is found’ …


(vipsoft) #5

We would only be able to delete the cookie for the user performing the update.

It won’t say cookie is found. I modified isIgnoreCookieFound to check for the the signed content.


(pista73.com) #6

My back-office (not piwik code) was creating a cookie in the back-office php code
setcookie(“piwik_ignore”, “.”, time()+63072000, “/”, “.domain.com”);

There are users I do not want to give access to piwik panel and also do not want to log their visits.
That cookie was working perfect in version 1.0 but not in the 1.1 anymore

Any idea to solve this?


(Matthieu Aubry) #7

pista, you can have your users optout with the new “opt out” iframe mechanism.


(pista73.com) #8

Hi matthieu, do you mean this patch?


(Matthieu Aubry) #9

Yes but it is part of 1.1, go to Admin > General settings > Optout section at the bottom


(pista73.com) #10

Thanks! Found it after post the message…

Just an add on block for the following scenario:
a) Not a piwik user
b) No message shown

step 1. in plugins\CoreAdminHome\Controller.php
below function public function optOut()
add the following code

public function optBlock()
{
	$trackVisits = !Piwik_Tracker_Cookie::isIgnoreCookieFound();
	if ($trackVisits === true) Piwik_Tracker_Cookie::setIgnoreCookie();
}

step 2. add anywhere in your code outside piwik the following:

it will be good if you have users that you don’t want to give access to piwik but at the same time their visits should be blocked.


(vipsoft) #11

Access to the opt out is being discussed.


#12

I posted a follow-up, but now I cannot find the message.
The ignore cookie is NOT working in 1.1.1. I have removed & restored.
Am I doing something wrong, or is there a fix?


#13

Hi - just installed Piwik today - all is working just lovely, thankyou.

However, regarding the “ignore” cookie, I notice that piwik_ignore is being set to the path “/piwik/” … this would mean that the cookie wouldn’t be recognised when any other path (eg the index page of the website) was loaded in the broswer - effectively unsetting the cookie in any path except /piwik. This would apply even if the javascript libraries/files are being loaded from the /piwik/ directory.

Best wishes,
Dean Richardson
iCounsellor.co.uk


(vipsoft) #14

Don’t worry about the path because the cookie is passed to Piwik and won’t (shouldn’t) be visible to apps outside the Piwik folder.


#15

Sorry, I wasn’t being clear.

I have the cookie “set” in both Chrome and Firefox, in the path /piwik/ and in the same domain of my website … yet Piwik is still recording my own visits to my site.

I understood that setting this cookie meant that my own visits to my own website would not be recorded. This is not working as described - Piwik is recording my own visits.


(vipsoft) #16

The path means the ignore cookie is only passed to piwik. If your visits are still being recorded, it’s not the path.

To clarify, the domain should be the associated with your piwik tracker (not the site being visited/tracked).


#17

I’m using 1.2.1 and am unable to have Piwik ignore my visits. I have set the “Opt Out” and it now reads:
"Opt-out complete; your visits to this website will not be recorded by the Web Analytics tool.
Note that if you clear your cookies, delete the opt-out cookie, or if you change computers or Web browsers, you will need to perform the opt-out procedure again. You are currently opted out
Is there a way to Ignore my IP? since I’m having such trouble with the opt out?
(BTW, a great utility - thank you.)


(Matthieu Aubry) #18

http://piwik.org/faq/how-to/#faq_80


#19

Thank you, but I never did find it until it was pointed out for me.
Thank you, again.


#20

Is there a way I can set the ignore cookie by adding php code to a specific site so everybody visiting this site will be ignored in the future?

Thanks.
Dirk