SOLVED

Re: Delete cookie on form fill

Go to solution
Oz_Platero
Level 6

Delete cookie on form fill

Hello Community,

 

I am in need of building a partner/referral page.  Some requisites needed

  • Disable web page visit tracking
    • Addressed on Landing Page template
      • Form page, and Follow up page
      • Working as intended
  • Delete cookie on form fill
    • Found an article in Marketo Dev pages. See Resources #1
    • Does not seem to be working. When I access the dev console on Follow up page the _mkto_trk attribute in the cookie still has a value in it.
    • I go back to the page with the form and resubmit to double check and the _mkto_trk attribute remains unchanged.

 

Resources

  1. https://developers.marketo.com/blog/clearing-marketo-tracking-cookie-from-forms-2-0-submission/
  2. Form page:
    1. noMunchkkinPage1.html
  3. Follow up page
    1. typage1-noMunchkin.html 
  4. Dev console on TY page
    1. document.cookie  -> "_mkto_trk=id:103-OIG-576&token:_mch-marketo.com-1111111111111-11111;
    2. (I changed the numbers to all 1's in the _mch-marketo.com)

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Delete cookie on form fill

On a referral form, you don’t have to actually remove the cookie from the browser’s cookie store.

 

In fact, you specifically don’t want to remove the cookie permanently, because the person filling out the form (the referrer) is also a lead in your db, and their own activity is still interesting. What you want to do is make sure the referral lead‘s record doesn’t take over the session.

 

So you have to remove the cookie from the form post, which is what the code in that blog post is designed to do. Taking advantage of a known quirk in the forms library, it empties the hidden field that normally holds the cookie when the form is submitted; the cookie in the browser isn’t touched.

View solution in original post

2 REPLIES 2
SanfordWhiteman
Level 10 - Community Moderator

Re: Delete cookie on form fill

On a referral form, you don’t have to actually remove the cookie from the browser’s cookie store.

 

In fact, you specifically don’t want to remove the cookie permanently, because the person filling out the form (the referrer) is also a lead in your db, and their own activity is still interesting. What you want to do is make sure the referral lead‘s record doesn’t take over the session.

 

So you have to remove the cookie from the form post, which is what the code in that blog post is designed to do. Taking advantage of a known quirk in the forms library, it empties the hidden field that normally holds the cookie when the form is submitted; the cookie in the browser isn’t touched.

Oz_Platero
Level 6

Re: Delete cookie on form fill

@SanfordWhiteman 

Thanks.