I have a client who just re-vamped their web site. When they did this they created Marketo LPs for each of the white papers and other assets on their site in Design Studio. I'm trying to figure out the best way to assign Lead Source and Lead Source Detail for leads who are created when they visit the web site and click through to an LP in order to download an asset. In other words, these are leads who are not part of a program. They found their own way to the LP. What the client wants, in that case is:
Lead Source: Website
Lead Source Detail: Asset Name (which is included in the name and URL of each LP)
I assume I can assign Lead Source to Website with a campaign with this Smart List:
Trigger:
New Lead is Created
Source Type is Web form fillout
Filter:
Member of Program is False
Program is Any
It's the Lead Source Detail I'm not sure how to handle. An obvious solution would be to use a hidden field on the Form(s). But the Form used on their WP LPs is also used by LPs in a number of Programs which contain campaigns that are setting the lead source and lead source detail to reference those programs (E.g., Lead Source: Content Syndication; Lead Source Detail: <CS Vendor Name>).
I can think of 2 solutions but both are fairly laborious:
1) Create Programs for all the Web Site Assets and move the LPs out of Design Studio and into the Programs. Create campaigns in each program to set the Source fields.
2) Create a separate form to be used on LPs for WPs downloaded directly from the web site and use hidden fields (it's laborious simply because there are a large number of LPs).
Does anyone have a better idea (or am I missing something simple and obvious)?
Thanks in advance!
Denise
Solved! Go to Solution.
If the Lead Source Detail is "included in the name and URL of each LP" -- by which I assume you mean the URL has a query param like &assetName=whitepaper1.pdf -- then set a hidden field that pulls the value from that param.
Hi Sanford,
All I meant was that the URL for the LP contained the asset name: white-paper123-LP.html.
I forgot to mention the 3rd solution of adding a parameter to the URLs on the client's web site linking to the LPs (in which case your suggestion would work). (That's also a challenge because my contact doesn't know how to do that nor have easy access to a resource who can do it for her).
Thank you!
So parse out the page name (document.location.pathname) and set a hidden field from that:
MktoForms2.whenReady(function(form){
form.addHiddenFields({ LeadSourceDetail : document.location.pathname});
});
Sanford,
I'm not a developer and don't quite follow your suggestion, forgive me. Where would I put that code? And the pathname will be different for each document. So how would it be retrieved?
Unless I can grasp and implement your solution, I think the best bet is to have the client bite the bullet and get someone to go in and change the URLs linking to the LPs on their web site to include parameters for Lead Source Detail to populate a hidden form field.
Denise
The pathname is different for each document, yes -- and we can always read the current document's pathname from any web page using the built-in variable document.location.pathname.
When viewing /example1.html, document.location.pathname is "/example1.html". When viewing /any-page-you-want.html, document.location.pathname is "/any-page-you-want.html". It automatically gets populated by the browser.
In Landing Page Editor, just an add an HTML block with these contents.
<SCRIPT>
MktoForms2.whenReady(function(form){
form.addHiddenFields({ LeadSourceDetail : document.location.pathname});
});
</SCRIPT>
Hey Sanford -
I'm sorry - I just realized I'm seeing your posts out of order and I didn't see the one above that tells me to add the HTML block until after I asked you where to put the code. Are you saying that this code would get added to each Landing Page (rather than the form)?
And sorry to be obtuse - but when you say "add an HTML bock", do I need something around that script or can I just plop it in anywhere?
Denise
Not instead of the form, in addition to the form.
In freeform LP Editor, drag the "HTML" icon onto the page. Then click the gear icon and click Edit.
Where do I tell the hidden field on the form to get the value from?
I implemented your code on a test LP but can't figure out how to get the Lead Source Detail populated, I can see "LeadSourceDetail: /Web-A-Little-Riak-Book-LP.html" this when I looked at the lead activity log and click on the detail for Filled Out Form but the Lead Source Detail field is still empty. I have a hidden field on the form and selected Referrer Parameter for where it should get the value. I'm not sure what I should be using for Parameter Name. I've tried lots of options but none have worked. I'm guessing that's the problem but am out of ideas.