SOLVED

Unable to delete cookie "_mkto_trk" from parent domain

Go to solution
David_Mezkiriz
Level 2

Hi,

 

I'm trying to delete _mkto_trk cookie when user decides to stop being tracked. I'm under this domain "online.example.com", so the tld is ".com" 

The _mkto_trk cookie has been created under this domain ".example.com"

 

I don't know if it's a cookie restriction, but when I try to delete it, the cookie remains there and it's not removed. These are the features of the cookie.

Domain: 

.example.com

Path:

Name:

_mkto_trk

HttpOnly:

false

 

I've tried to do this:

document.cookie = "_mkto_trk=; path=/; domain=.example.com;expires=Thu, 01 Jan 1970 00:00:01 GMT"

but unfortunately it isn't removed.

If I enter this command:

document.cookie

obviously the cookie is not listed, I think because I'm under the "online.example.com" and by cookie restrictions you are not allowed to see cookies of the parent domain "example.com", I don't know if these restrictions are linked to remove them.

 

My code, initializes the munchkin code "Munchkin.init" , without any domainLevel option.

Munchkin.init('xxx-xxx-xxx');

and it creates the cookie as stated above.

 

Is there anything I can do to remove the_mkto_trk cookie when customer decides?

 

Thank you!!

David

1 ACCEPTED SOLUTION
SanfordWhiteman
Level 10 - Community Moderator

1. My conditional Munchkin.init() statement, part of the "munchkin-beta.js" file

2. The code that Marketo LPs executes (if and if only I enable the munchkin tracking) Munchkin.init("ABC-123-456", { marketoPageLevelOptions }) which is part of the munchkin.js file.


Not quite... overall, there are 3 calls to a function called init(), but that isn't the way I'd refer to them.

 

The 1st is a call to a overridden init()that caches Marketo's page-level options.

 

The 2nd is a another call to an overridden init()that adds user-level config options.

 

The 3rd is a call to the actual/original Munchkin init()method that passes in a combo of page-level and user-level options.

 

The 2nd call automatically makes the 3rd call, you don't make the 3rd call yourself but it's there under the hood.

View solution in original post

10 REPLIES 10