SOLVED

Re: Referrer Parameter

Go to solution
Adam_Vavrek1
Level 9 - Champion Alumni
I have included a hidden field for Referrer Parameter on a form but it's not capturing any data. There's nothing to add in the URL Builder (like there would be if I had selected URL Parameter) so I don't know where to go from here. What steps (if any) am I missing to capture this data?
Tags (1)
1 ACCEPTED SOLUTION
Valerie_Armstro
Level 10 - Champion Alumni
Hi Adam,

The Referrer Parameter captures data from the previous page the lead visits before filling out the form.  

As to how to set this up, I would explain it this way
  • Create a form with a hidden referrer parameter field (i.e. source) 
  • Add the form to the page www.example.com/download-page.html
​Now, for any traffic that converts on that download page, you will capture the source parameter of the lead's previous web page visit.   So for instance, if the lead visited  www.example.com/test-page.html?source=adwords before visiting and converting on the download page, the source would be attributed to adwords.   

This can be a bit confusing to explain and understand, so I highly suggest building this out as a test and seeing it for yourself. Hope this helps!

View solution in original post

22 REPLIES 22
Anonymous
Not applicable

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!

Capture.JPG

JD_Nelson
Level 10 - Community Advisor

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.

Anonymous
Not applicable

Thanks JD. Is there any where to simply pull the URL the person came from?

SanfordWhiteman
Level 10 - Community Moderator

Carey, I answered that question above.

Anonymous
Not applicable

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?

SanfordWhiteman
Level 10 - Community Moderator

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.

Anonymous
Not applicable

Superman Sanford Whiteman​ to the rescue. Thanks for the info.

Anonymous
Not applicable

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

SanfordWhiteman
Level 10 - Community Moderator

What's the actual URL, so I can verify your setup?

Anonymous
Not applicable
SanfordWhiteman
Level 10 - Community Moderator

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 });
});

Anonymous
Not applicable

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 

SanfordWhiteman
Level 10 - Community Moderator

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.

Anonymous
Not applicable

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

SanfordWhiteman
Level 10 - Community Moderator

    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.

SanfordWhiteman
Level 10 - Community Moderator

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.

SanfordWhiteman
Level 10 - Community Moderator

Jessica Bledsoe​ if you're searching on this topic you should also read Re: Need to Track the reference URL ?

Anonymous
Not applicable

Thanks Sanford Whiteman​!

Valerie_Armstro
Level 10 - Champion Alumni
Hi Adam,

The Referrer Parameter captures data from the previous page the lead visits before filling out the form.  

As to how to set this up, I would explain it this way
  • Create a form with a hidden referrer parameter field (i.e. source) 
  • Add the form to the page www.example.com/download-page.html
​Now, for any traffic that converts on that download page, you will capture the source parameter of the lead's previous web page visit.   So for instance, if the lead visited  www.example.com/test-page.html?source=adwords before visiting and converting on the download page, the source would be attributed to adwords.   

This can be a bit confusing to explain and understand, so I highly suggest building this out as a test and seeing it for yourself. Hope this helps!
Anonymous
Not applicable

Thanks valerie