SOLVED

Re: Munchkin cookie disappears if user refreshes the page after giving consent to cookies

Go to solution
NestoJosa
Level 3

Munchkin cookie disappears if user refreshes the page after giving consent to cookies

Hello again!

 

We have created a landing page, where the munchkin cookie disappears when you refresh the page (after accepting all cookies):

<deleted-url-to-site>

 

Does anybody have an idea of what can be causing this issue?

 

The setup:

- Cookie-banner is set via GTM container.

- If user gives consent a trigger fires, that sets the Marketo Munchkin cookie.

 

Any help would be much appreciated!

 

Best,

ernie

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Munchkin cookie disappears if user refreshes the page after giving consent to cookies

Your cookie consent code is explicitly deleting it on refresh. As you can see here, the variable o is empty, which is how you delete a cookie.

SanfordWhiteman_1-1626268683062.png

 

 

View solution in original post

3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: Munchkin cookie disappears if user refreshes the page after giving consent to cookies

Your cookie consent code is explicitly deleting it on refresh. As you can see here, the variable o is empty, which is how you delete a cookie.

SanfordWhiteman_1-1626268683062.png

 

 

NestoJosa
Level 3

Re: Munchkin cookie disappears if user refreshes the page after giving consent to cookies

Hi @SanfordWhiteman!

 

Thanks for your prompt response!

 

Now, do you have any idea as to why this is happening?

 

When I check the console, there is also a warning, when you refresh the page, saying 'Cookie “_mkto_trk” has been rejected for invalid domain.'

 

I think that this is the reason as to why the cookie is being set with an empty string  - its being deleted because the domain is invalid for some reason. But I simply cannot figure out why. 

 

Thanks in advance!

SanfordWhiteman
Level 10 - Community Moderator

Re: Munchkin cookie disappears if user refreshes the page after giving consent to cookies


When I check the console, there is also a warning, when you refresh the page, saying 'Cookie “_mkto_trk” has been rejected for invalid domain.'

Your cookie consent code does have a “tree-walking” test where it tries to delete and reset the cookie at every possible parent level (not a very well-written test, I must say). You’d have to talk to the vendor to discover how you can ensure the cookie is preserved, rather than being deleted and never recreated.