Storing the Referrer URL as a Form Field | Community
Skip to main content
Level 4
April 12, 2016
Question

Storing the Referrer URL as a Form Field

  • April 12, 2016
  • 2 replies
  • 6101 views

Hello All,

I need to capture the referring url (entire URL) in a form field on my landing page. I tried using the hidden fields option but it only allows

fields from cookies, url parameters and url parameters from referring urls BUT not the entire referral url.

Is there any option to capture this information?

Best Regards,

Manish Khemani

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Grégoire_Miche2
Level 10
April 12, 2016

Hi Manish,

You will need a couple of lines of JS code to do this. You will have to capture the referrer and use the forms 2.0 to fill the field.

Forms 2.0 » Marketo Developers

-Greg

Robb_Barrett
Level 10
April 12, 2016

If you're hoping to capture keywords, no luck. Google and Bing have discontinued including keywords in the referrer. They don't want you to be able to associate a user with a search.  Google webmaster tools are a better bet for getting keywords.

If you're looking to find if they clicked you from a third party place you're in luck. That should still work.

However, just as an FYI, I find it better to write to a list if they're coming from a finite amount of places. This makes for much better reporting and multi-touch attribution. A single field is volatile to get overwritten. Marketo already stores the original referrer by default.

Robb Barrett
Level 4
April 13, 2016

Hi Robb,

Thanks for your reply,

My only requirement is only the referrer URL which got the user to my

landing page that contains a marketo form. is there any option to capture

the referrer information from the http header of the landing page and

storing it in a hidden form field?

With Best Regards

Manish Khemani

Tata Consultancy Services

Mailto: manish.khemani@tcs.com

Website: http://www.tcs.com

SanfordWhiteman
Level 10
April 13, 2016

<script>

MktoForms2.whenReady(function(form){

  form.setValues({

    OriginalExternalReferrer : document.referrer

  });

});

</script>

Note the Original Referrer built-in field will capture the acquisition URL, so you want to make sure to disambiguate the field names. In this case I assume you've created a Marketo custom field called Original External Referrer.

N.B. you will never see any external document referrers that are running if your landing page is not also running .