Hello,
It may be due to my unability to use your tool even as it seems pretty straightforward.
I want to remove all cookies left over after blocking GA. My .js file contains following code:
window['ga-disable-UA-XXXXXXXX-X'] = true; // This blocks GA service, works properly.
var DelCookies = Cookies.noConflict();
var cookies = DelCookies.get();
if ( '' !== cookies ) {
jQuery.each( cookies, function( index ) {
index = '' + index;
if ( '_ga' === index || '_gid' === index || '_gat' === index ) {
DelCookies.remove( index, { path: '/' });
}
});
}
But cookies are still there when I check Chrome's developer console. I used '/' as domain path. I've found this path in the developer console as well.
Best regards, Dan.
Hi Dan, you may have to add the domain attribute as well, which must match the one with which the cookies had been written.
DelCookies.remove( index, { path: '/', domain: '.yourdomain.com' });
Well, it worked! Thank you!
Call me blind but I can't find this information anywhere on the plugin's main page.
Regards, Dan.
It鈥榮 mentioned in the readme:
IMPORTANT! When deleting a cookie, you must pass the exact same path and domain attributes that were used to set the cookie
@junglized Any suggestion on how we can improve the README to make that information clearer for other people?
@carhartl It's mentioned but with no obvious example of how the code should look like afted adding 'domain' attribute. One might thing the domain should be put where the 'path' is, i.e.:
Cookies.remove('name', { path: 'yourdomain.com/the/path' });
@FagnerMartinsBrack Under the line saying
IMPORTANT! When deleting a cookie, you must pass the exact same path and domain attributes that were used to set the cookie
I would add the line showing exactly how the code with domain attribute should look like:
Cookies.remove('name', { path: '', domain: 'yourdomain.com' });
Thank you very much guys for your time given to help me out.
Best regards, Dan.
Most helpful comment
@carhartl It's mentioned but with no obvious example of how the code should look like afted adding 'domain' attribute. One might thing the domain should be put where the 'path' is, i.e.:
Cookies.remove('name', { path: 'yourdomain.com/the/path' });@FagnerMartinsBrack Under the line saying
I would add the line showing exactly how the code with domain attribute should look like:
Cookies.remove('name', { path: '', domain: 'yourdomain.com' });Thank you very much guys for your time given to help me out.
Best regards, Dan.