SOLVED

Re: SFDC Campaign assignment based on form submissions and querystring data

Go to solution
Pavel_Ivanov
Level 2

Re: SFDC Campaign assignment based on form submissions and querystring data

Hi @SanfordWhiteman,

Thank is amazing and described so much better than I did on our internal meetings. Thank you for writing about this.

SanfordWhiteman
Level 10 - Community Moderator

Re: SFDC Campaign assignment based on form submissions and querystring data

Great! One of the reasons I put stuff on the blog is so I myself can link to it instead of having to explain to people on the spot. 🙂

SanfordWhiteman
Level 10 - Community Moderator

Re: SFDC Campaign assignment based on form submissions and querystring data

This seems overengineered.

 

If you want the form to NULL out your hidden fields when the corresponding query params are not present, then set the default form field value to NULL.

Chris_Willis1
Level 8 - Champion

Re: SFDC Campaign assignment based on form submissions and querystring data

^ This

Pavel_Ivanov
Level 2

Re: SFDC Campaign assignment based on form submissions and querystring data

Hi Sanford,

 

The default form field value is NULL. It's a new field that we're yet to create, so no information will be recorded in it until anyone submits a form.

 

Apologies if I  have not explained correctly the logic I have in my mind:

Set to NULL:

  • The hidden querystring field after each form fill, so it's ready for the following form submission (if any, ever). The default will indeed be empty. I don't need this information staying there for more that it would take for the flows to work and assign the people to the right SFDC campaign
  • The utm field values only when a form submission is coming through direct/organic and the lead has historic utm values from previous form fills

Keep info in utm fields:

  • If the last form submission was one with them present

Does that make sense?

SanfordWhiteman
Level 10 - Community Moderator

Re: SFDC Campaign assignment based on form submissions and querystring data


The hidden querystring field after each form fill, so it's ready for the following form submission (if any, ever). The default will indeed be empty. I don't need this information staying there for more that it would take for the flows to work and assign the people to the right SFDC campaign

You’re just setting yourself up for race conditions and difficult-to-follow logic.

 

There’s no ill consequence from having a field keep its value until overwritten by another round of user input. The key is that you want all your UTM fields to be updated as a group — you don’t want utm_medium to come from one form post while utm_term comes from another.

 

So call the fields something useful (Most Recent UTM Medium, etc.) and make sure that on any given form post they’re either sent as the real value (from the URL) or default to the literal value “NULL“ (which will empty the field if they weren’t in the URL).

Pavel_Ivanov
Level 2

Re: SFDC Campaign assignment based on form submissions and querystring data


There’s no ill consequence from having a field keep its value until overwritten by another round of user input.


The reason I want to reset/empty the field value of the "querystring" field after each submission is that if a new form submission comes through with no querystring (for example, someone types in our website url and goes on to fill out a form) then it the field will keep it's previous value.

Marketo will not automatically update it to NULL.

What do you think?

 

 

SanfordWhiteman
Level 10 - Community Moderator

Re: SFDC Campaign assignment based on form submissions and querystring data



if a new form submission comes through with no querystring (for example, someone types in our website url and goes on to fill out a form) then it the field will keep it's previous value.

Marketo will not automatically update it to NULL.

What do you think?


I think (know) that this is not true, because if the default value of an auto-filled hidden field is the string “NULL”, Marketo will send the string “NULL” to the server if the query param is not present. And “NULL” is Marketo’s special keyword that erases the previous value.

Pavel_Ivanov
Level 2

Re: SFDC Campaign assignment based on form submissions and querystring data

Sanford,

 

What you just said is news to me.

I admit I have never actually thought I can setup the default value of a hidden field to be NULL. In fact I think this renders all complex setup of the querystring field useless. If we're sure that the UTM fields are updated with no leftovers from previous form submits, then this should solve the issue.

 

Off to testing now. I'll update to thank you once again when I'm done.

Pavel_Ivanov
Level 2

Re: SFDC Campaign assignment based on form submissions and querystring data

@SanfordWhiteman,

Brilliant, as usual. It's working as intended.

Thank you!