SOLVED

How to create a field that grabs the web page the form was filled out on?

Go to solution
Highlighted

How to create a field that grabs the web page the form was filled out on?

Hello Everyone!

We are looking at creating a field that will grab the web page the form was filled out on.  We then would like to add this as a token in and alert that goes to sales when a form is filled out?  Do anyone have any ideas of how to accomplish this?
Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Level 10 - Community Moderator

Re: How to create a field that grabs the web page the form was filled out on?

@Nate O Easily done with a hidden field.

MktoForms2.loadForm("//app-**01.marketo.com", "***-***-***", 148,
    function(form) 
    {
        form.addHiddenFields({ LastFormURL : document.location.href })    
    });
 

View solution in original post

14 REPLIES 14
Highlighted
Marketo Employee

Re: How to create a field that grabs the web page the form was filled out on?

Hey Nate,

You'll want to create a smart campaign with Smart List Fills Out Form, and Flow, Change Data Value, MyField, New Attribute is {{trigger.Web Page}}
Highlighted

Re: How to create a field that grabs the web page the form was filled out on?

Hi Kenny,

I tried that and it doesn't populate the field.  It would be an external web page that we want to populate the field with because the form is on an external web page.  Any ideas?
Highlighted
Level 10 - Community Moderator

Re: How to create a field that grabs the web page the form was filled out on?

@Nate O Easily done with a hidden field.

MktoForms2.loadForm("//app-**01.marketo.com", "***-***-***", 148,
    function(form) 
    {
        form.addHiddenFields({ LastFormURL : document.location.href })    
    });
 

View solution in original post

Highlighted
Level 2

Re: How to create a field that grabs the web page the form was filled out on?

Sanford Whiteman I know it's been a few years since you posted this, but it was EXACTLY what I was looking for. Dropped the code right in and everything worked flawlessly. Thank you, Sir!!!

Highlighted
Level 10 - Community Moderator

Re: How to create a field that grabs the web page the form was filled out on?

Great to hear!

Highlighted
Level 3

Re: How to create a field that grabs the web page the form was filled out on?

Hi Sanford,

Sorry to reply to such an old post, but I was wondering, would this still work on a webpage that doesn't have any Marketo Munchkin tracking? We need to embed one of our forms on a partner website.

Thanks!

Highlighted

Re: How to create a field that grabs the web page the form was filled out on?

Hi Sanford,

Would I have our developer put that whole code just like it is with the asterisks and everything in the form we have embedded on multiple external web pages?
Highlighted
Level 10 - Community Moderator

Re: How to create a field that grabs the web page the form was filled out on?

The asterisks represent your company's Marketo data (your Munchkin ID and Marketo instance). Your developer will know what to do if s/he is already using the embed code.
Highlighted

Re: How to create a field that grabs the web page the form was filled out on?

Hi Sanford,

So only this code is needed to trace the last form URL? And, the webmaster will know what to put in the asterisks?

MktoForms2.loadForm("//app-**01.marketo.com", "***-***-***", 148,

    function(form)

    {

        form.addHiddenFields({ LastFormURL : document.location.href })   

    });

Then, I also need to create a smart campaign with Smart List Fills Out Form, and Flow, Change Data Value, MyField, New Attribute is {{trigger.Web Page}}? For the MyField I created a custom "Web Page Source" field, which I can add to my alert email.