We are in the process moving to using Wordpress as our CMS. We are going to use a single global embedded Marketo form on each page of our Wordpress site. My goal is to be able to capture the specific URL of the page the person is when they fill out the form using a hidden field on the form called "Lead Source Details". I don't currently use UTM fields on those pages.
Here is a quick snapshot of how I would like this to go.
I have created the embedded form and know how to embed it into my Wordpress page.
Here is where I need help: If I don't have any UTMs set up on my pages and I just want to pull the full page URL (or page name if that's possible), what value do I type into the field "URL Parameter"?
Thank you so much! I have been reading all over the place and can't seem to figure this out on my own.
First, to be very clear: www.assetworks.com/case-studies/city is not the URL the person is on because you're stripping off the http:// or https:// that makes a complete URL.
Let's call the value you're talking about the "web page" rather than the "URL" to be proper. And in fact, this value is already part of the Filled Out Form activity so you can trigger/filter on it.
But if you want it to also be set as the value of the custom field Lead_Source_Details:
Do your usual:
MktoForms2.loadForm( ... );
then add
MktoForms2.whenReady(function(form){
form.addHiddenValues({
Lead_Source_Details : encodeURIComponent(document.location.href.replace(/^https?:\/\//,""))
});
});
You can do this with a token trigger and a single global campaign, which is probably the easiest method.
SMART LIST
Fills Out Form
FLOW
Change Data Value - Lead Source Details - New Value = {{trigger.Web Page}}
Tokens for Interesting Moments - Marketo Docs - Product Docs
In practice I have found this to work for both Marketo landing pages and external sites as long as Munchkin is present. However test carefully to make sure this holds true for your environment.
Thank you so much Justin! That is really helpful and i was able to test it. It works great! And the other links you shared with me are very helpful as well.