SOLVED

Add Variables from Form as Parameters for Thank You Page

Go to solution
Jo_Pitts1
Level 10 - Community Advisor

Re: Add Variables from Form as Parameters for Thank You Page

Nope.. it was just the first example I could find 🙂

SanfordWhiteman
Level 10 - Community Moderator

Re: Add Variables from Form as Parameters for Thank You Page

It doesn’t seem to have gone through any testing at all. The RegExp is bonkers.

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Add Variables from Form as Parameters for Thank You Page

FYR: This post on the nation also describes the concept of storing the UTMs in to a cookie and referencing it to add UTM values to the form's hidden UTM fields when the user fills out the form w/o UTMs.

Jo_Pitts1
Level 10 - Community Advisor

Re: Add Variables from Form as Parameters for Thank You Page

Nice spot @Darshil_Shah1.

I don't think the part to populate the fields into the form is needed any more right, as Marketo can do that natively now.

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Add Variables from Form as Parameters for Thank You Page

You mean adding autofill on the hidden fields using the cookie value, right?

Jo_Pitts1
Level 10 - Community Advisor

Re: Add Variables from Form as Parameters for Thank You Page

Correct

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Add Variables from Form as Parameters for Thank You Page

Would there be any race condition between the hidden form fields getting populated from the cookie by the form auto-fill and cookie being set/updated by the script? Wouldn't possibly wanna risk the possibility of hidden form values getting populated with the existing cookie values before the cookie can get updated with the new values from the UTMs. The script has a defined order of operations - first create/update the cookies from the UTMs if present, and then plug them in the hidden form fields.

SanfordWhiteman
Level 10 - Community Moderator

Re: Add Variables from Form as Parameters for Thank You Page


Would there be any race condition between the hidden form fields getting populated from the cookie by the form auto-fill and cookie being set/updated by the script? Wouldn't possibly wanna risk the possibility of hidden form values getting populated with the existing cookie values before the cookie can get updated with the new values from the UTMs. The script has a defined order of operations - first create/update the cookies from the UTMs if present, and then plug them in the hidden form fields.

There’s no race condition if the code that manages the cookies runs before loadForm().

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Add Variables from Form as Parameters for Thank You Page

yeah - spot on!