How to delete _mkto_trk on Marketo 2.0 form submit | Community
Skip to main content
Opine_Consulti4
June 30, 2016
Solved

How to delete _mkto_trk on Marketo 2.0 form submit

  • June 30, 2016
  • 2 replies
  • 2817 views

We are in the process of implementing EU cookie privacy directive on the main website and also Marketo landing pages. I've seen some references to Marketo automatically creating the _mkto_trk cookie on form submit if it isn't already there. Can anyone verify if this is true? Just trying to figure out the best way to deal with this situation:

- User indicates no tracking 

- munchkin.init is not run and _mkto_trk is not set.

- On page load, if _mkto_trk is set, it is deleted

- Marketo Form 2.0 is submitted and goes to a follow-up page so even if the _mkto_trk is set, it is deleted on page load (per above)

Here's the part I'm really asking about:

If the Marketo Form 2.0 is shown in a modal or in a lightbox, after submission there is no page load generated. If the cookie is really automatically created, then it needs to be deleted. Would you delete _mkto_trk in an on success handler or is there a better way to manage this?

Any tidbits for implementation would be much appreciated!

Thanks,

Sheila

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

The Forms 2.0 library does not create cookies itself. Only Munchkin creates Munchkin cookies, so if you are preventing Munchkin from loading (i.e. not including the script) you do not need to do anything else, since when the Forms library looks for the global Munchkin object, it won't find it.

I've found that even if you do load the Munchkin bootstrapper, if you skip Munchkin.init() you will be fine.  However, there appears to be a difference of opinion (see below) about whether this latter case relies on a buggy implementation or not.  So I'd recommend skipping the script entirely to be future-proof.

2 replies

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
June 30, 2016

The Forms 2.0 library does not create cookies itself. Only Munchkin creates Munchkin cookies, so if you are preventing Munchkin from loading (i.e. not including the script) you do not need to do anything else, since when the Forms library looks for the global Munchkin object, it won't find it.

I've found that even if you do load the Munchkin bootstrapper, if you skip Munchkin.init() you will be fine.  However, there appears to be a difference of opinion (see below) about whether this latter case relies on a buggy implementation or not.  So I'd recommend skipping the script entirely to be future-proof.

Kenny_Elkington
Adobe Employee
Adobe Employee
June 30, 2016

Sanford's answer isn't correct, for uncookied leads, the cookie will be created during submission.  You can delete it during the success handler as you indicated.

SanfordWhiteman
Level 10
June 30, 2016

Not if you don't load the Munchkin library. I should have said "If you are preventing Munchkin from loading" as opposed to "initing".‎ 

EDIT: I take back my take-back.  My original phrasing was correct, because even if the Munchkin bootstrapper script (munchkin-beta.js) loads, the forms lib will not automatically run init() for you, so the cookie creation process will just sit on the callback stack waiting for init(). Forms may want to create the cookie, but it can't.  Perhaps there was a regression at some point, but right now I cannot see how this would work, let alone work safely.

Opine_Consulti4
June 30, 2016

Thank you both. Exact information I was looking for!

Sheila