Redirect to Thank You page and append query variables to the URL

mounica_tunugun
Level 2

Hi There,

I have 2 assets and i'm using same form for both assets after submit i'm redirecting them to same thank you page. So i'm getting difficulty in analyzing the traffic from which asset most number of forms submitting. So for this i'm thinking to add asset name in the thank you page URL as a query string. So For suppose consider A & B are asset page if I submit form from A URL should be www.websitename.com/thankyou/a like this is it possible OR any other way? 

24 REPLIES 24
mounica_tunugun
Level 2

Thank you so much for the help. This worked form me and one last question,
As I mentioned based on campaign name we are placing one link in the choice section, how to store these campaign names from wordpress dashboard to marketo form on submit.

For suppose consider a page with form in the page, in that page I have a campaign name called X. On form submit from that page, I want to updated that X campaign name in marketo. 

SanfordWhiteman
Level 10 - Community Moderator

Thank you so much for the help. This worked form me...

Great, can you mark my answer (the recent one with the code) as Correct?

... and one last question,

As I mentioned based on campaign name we are placing one link in the choice section, how to store these campaign names from wordpress dashboard to marketo form on submit.

For suppose consider a page with form in the page, in that page I have a campaign name called X. On form submit from that page, I want to updated that X campaign name in marketo. 

That's actually 2 questions.

First is easy, if the campaign name is a Wordpress page-level variable or suchlike, output it into JavaScript, then call form.addHiddenFields to add it to the form.

Second is not possible. You can't use a form field value (e.g. database field value) in a flow step that expects a Smart Campaign, even if the value exactly matches a Marketo Campaign Name. (Actually, it's the numeric Campaign ID that's stored, not the Campaign Name, but that doesn't work either.) You have to build options using Add Choice and hard-code each possible value.

mounica_tunugun
Level 2

Need to do first option can you help me in doing that.

SanfordWhiteman
Level 10 - Community Moderator

You'll have to get it into JS first (like into a global JS variable), then I can show you how to add it as a form field.