Re: How to pass URL parameters or cookie when submit form

Anonymous
Not applicable

How to pass URL parameters or cookie when submit form

Hi guys,

I have looked at some articles:

http://community.marketo.com/MarketoArticle?id=kA050000000KyqoCAC

http://community.marketo.com/MarketoArticle?id=kA050000000L8SwCAK

http://community.marketo.com/MarketoResource?id=kA650000000GsPJCA0


To do pass URL parameters or cookie into hidden field when submit form.
I just see the script on Mkto:

<script type="text/javascript">
 var mktoPreFillFields = {"Email":decodeURIComponent("lamnt%personal.com"),"utm_campaign__c":decodeURIComponent("na"),"utm_content__c":decodeURIComponent("na"),"utm_medium__c":decodeURIComponent("na"),"utm_source__c":decodeURIComponent("na"),"utm_term__c":decodeURIComponent("na")};
</script>

But i don't know how to implement this on my site. Anyone can help me about that?

Thanks,
Lam

 

Tags (1)
5 REPLIES 5
Anonymous
Not applicable

Re: How to pass URL parameters or cookie when submit form

Hi Nam,

Is it a Marketo form?

When you change a field to be hidden on the form, you can edit the values on the form and it asks where you'd like to capture the value from.  URL or Cookie should be one of your options and you can simply specify what the parameter is in the given text box.

I may be missing something in your question though.  There is no script needed.
Anonymous
Not applicable

Re: How to pass URL parameters or cookie when submit form

Hi Michael,

Yes, It's Mkto form.
I also think about that, there is no script need to do that.

But it didn't work right on my site. I already specify use the option get value from Cookie. I think it should be get the values from cookie automatic when submit form!
If it doesn't work automatic, i need to customize and add these values from cookie to hidden fields via javascript.

Anonymous
Not applicable

Re: How to pass URL parameters or cookie when submit form

Hi Nam,

When you say that its on your site, do you mean on your actual website?  How are you embedding the form?  

a. Marketo Form on Marketo Landing Page
b.  Marketo Form on Non Marketo Page (your website) via embedding the HTML
c.  Marketo Form on Non Marketo Page with iFrame
Anonymous
Not applicable

Re: How to pass URL parameters or cookie when submit form

Another thing to take into consideration is if you are iframing your form into your site, then you will need to provide a script that can pull parameters from the parent URL, or else the iframed form will not see the parameters.
Anonymous
Not applicable

Re: How to pass URL parameters or cookie when submit form

@Micheal:
My site has already embed Mkto form before and it works fine. I just update a few things, add one more hidden field get value from URL parameters(Google Adword links).
I do same the dicussion on here: http://community. mymarketo.com/MarketoArticle?id=kA050000000KyqgCAC

b. Marketo Form on Non Marketo Page (your website) via embedding the HTML

But, ater submit, i checked the activity on leads and see all value is NULL(which set as a default value in Mkto form.)

@Kenny: Yes, i submit this form to an iframe, because i need this form submit the other to caputre it. How can i pass URL parameters to iframe also?

current, the iframe on my site :

<iframe id="mktoformhidden" name="mktoformhidden" style="display:none; visibility:hidden;">
</iframe>

Marketo form will be target to this iframe when submit.

Can i put iframe.src = window.location.href ?

 

Thanks,