Solved! Go to Solution.
I have a follow up question because I'm new to the URL and Referrer Parameter. I can see how to add the URL Parameter, but what value to I type in the field "Parameter Name"?
We are using a field called "Lead Source Details" and I want that to capture which page of our website the form was filled out on. I included an image of the Support Documentation example.
Thank you!
This name must match the utm in the url. If your url is http://www.company.com/page1.html?product_interest=XYZ then this example would work.
Thanks JD. Is there any where to simply pull the URL the person came from?
Carey, I answered that question above.
Thanks Sanford. I went back and read the thread where you replied. To be honest, I'm more of an Marketo end user than a developer. Can you tell me specifically what I should type in the field "Referrer Parameter"? We are embedding these forms on our website, so they just have an URL address such as www.assetworks.com/products/fleetfocus-fleet-management-software
Is it possible for us to see that address as the Referrer parameter without appending anything the URL itself?
You don't need to append to anything. But you do need to have a custom Lead field in your Marketo database to hold the value! You can call this field lastReferrerURL.
Then, in your landing page, after the embed code, put this SCRIPT block:
<SCRIPT>
MktoForms2.whenReady(function(form){
form.addHiddenFields({ lastReferrerURL: document.referrer })
});
</SCRIPT>
Bear in mind that not all pages will have a Referrer, even if they appear to have a "previous page." This is one very good reason that this functionality is not enabled by default, because it would confuse most users. For example, if someone clicks on an ad on https://somedomainrelevanttomyvertical.com to go to http://assetworks.com/landingpage1.html (note that your page is not https://) then you will not see a Referrer. This part of the definition of how Referrers work and is not unique to Marketo.
Superman Sanford Whiteman to the rescue. Thanks for the info.
Hi Sanford,
Again, great post and advice. I was created the exact same custom field and also added the exact same scripts to the landing page. However, when I filled the form and new lead did not capture the last referrer url.
Referrer URL: http://info.mydomain.com/ABC ( marketo landing page)
Landing Page URL: http://info.mydomain.com/DEF ( another marketing landing page)
Any idea why it did not work?
Vincent
What's the actual URL, so I can verify your setup?
Thanks for following us Sanford. Here are the actual link
Referrer URL: http://connect.oncourselearning.com//Create-program_Request-Page.html
Landing Page URL: http://connect.oncourselearning.com/Whitepaper-gk_01-promotional-page-gk.html
Syntax error (which is because I just typed my code on my phone that day!):
MktoForms2.whenReady(function(form){
form.addHiddenFields{ lastReferrerURL: document.referrer }
});
Should be
MktoForms2.whenReady(function(form){
form.addHiddenFields({ lastReferrerURL: document.referrer });
});
Hi Sanford,
OMG! It's working and you have no idea how awesome it is !!Thank you so much!
One additional question, is there any way to look at anonymous leads' last referral url? In other words, what about the source of those people who visited the page but did not fill out the form.
Sincerely,
Vincent
I was going to write back to you about this in the other thread Capture keyword and lead source information for leads/visitors down to Purchase.
A lot has changed w/r/t anonymous leads since we were discussing this stuff. Marketo is no longer the place you should be tracking anonymous leads while they are still anonymous. It's still the place to track the originally anonymous activities of a lead that took place before the lead became known (was "promoted" in the new parlance. But if you want to be trending leads before they convert you should use Google Analytics instead.
See more comments under Capturing Lead Source Using UTM Fields and lots of other places where the new restrictions are discussed.
Is there a way to do that for the source URL? I have a field called "Lead_Source_Details" where I can store it.
My ultimate goal based on your example would be to see a form fill that looks like this:
Name: John Smith
email: john@smith.com
Lead Source Details: http://assetworks.com/landingpage1.html
form.addHiddenFields({ Lead_Source_Details : document.location.href });
But because a form can exist on many pages, those pages can be renamed, and each of those pages can be linked to from various sources, it's relatively uncommon to rely solely on the current URL. Rather, that's why you have hidden field options like "autofill from URL parameter," so you can set the lead source details there and it'll work on both /landingpage1.html?lead_source_details=sourceA and /landingpage223344.html?lead_source_details=sourceA.
Also note that the hosting web page already is logged and can be used as a trigger, though that's not exactly the same as saving it to the lead.
Jessica Bledsoe if you're searching on this topic you should also read Re: Need to Track the reference URL ?
Thanks Sanford Whiteman!
Thanks valerie