<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: Capture http referrer url in hidden field</title>
		<link>https://legacy.forums.gravityhelp.com/topic/capture-http-referrer-url-in-hidden-field</link>
		<description>Gravity Support Forums Topic: Capture http referrer url in hidden field</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 03:17:03 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/capture-http-referrer-url-in-hidden-field" rel="self" type="application/rss+xml" />

		<item>
			<title>David Peralty on "Capture http referrer url in hidden field"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/capture-http-referrer-url-in-hidden-field#post-62385</link>
			<pubDate>Wed, 13 Jun 2012 07:17:20 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">62385@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;vmanepete - If you set the default value to be the HTTP Ref URL, then you shouldn't need to do what I listed above. Though double check that it gets picked up properly and sent along.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>vmanepete on "Capture http referrer url in hidden field"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/capture-http-referrer-url-in-hidden-field#post-62363</link>
			<pubDate>Tue, 12 Jun 2012 23:48:33 +0000</pubDate>
			<dc:creator>vmanepete</dc:creator>
			<guid isPermaLink="false">62363@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;David,&#60;/p&#62;
&#60;p&#62;I tried implementing this with ZOHO CRM. Looks like, when adding the HIdden Field to your form you may have to also select &#34;HTTP Refererl URL&#34; under Insert Merge Tag dropdown. &#60;/p&#62;
&#60;p&#62;Is this correct?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>silverscape on "Capture http referrer url in hidden field"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/capture-http-referrer-url-in-hidden-field#post-59158</link>
			<pubDate>Wed, 16 May 2012 12:09:50 +0000</pubDate>
			<dc:creator>silverscape</dc:creator>
			<guid isPermaLink="false">59158@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks so much for the quick reply! I will give this go and revert back to you.....I appreciate the step-by-step approach!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Capture http referrer url in hidden field"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/capture-http-referrer-url-in-hidden-field#post-59157</link>
			<pubDate>Wed, 16 May 2012 11:51:51 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">59157@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi J,&#60;/p&#62;
&#60;p&#62;So there are a few simple steps that I can help you with. &#60;/p&#62;
&#60;p&#62;FORM SET-UP&#60;br /&#62;
You will need a field to put in the referrer URL so that it gets saved to the entries table in Gravity Forms. &#60;/p&#62;
&#60;ol&#62;
&#60;li&#62;Create a Hidden Field in your Form. (Hidden FIelds are in the Standard Fields set)&#60;/li&#62;
&#60;li&#62; Give it a label (Ref URL) - The label isn't important but helpful&#60;/li&#62;
&#60;li&#62; Under the Advanced Tab, click the check box for Allow Field to be Populated Dynamically&#60;/li&#62;
&#60;li&#62;Give it a Parameter Name (refurl)&#60;/li&#62;
&#60;/ol&#62;
&#60;p&#62;FUNCTIONS.PHP Changes&#60;br /&#62;
You will need to create a function to grab the referrer URL and pass it to the hidden field.&#60;/p&#62;
&#60;p&#62;#1 - In your theme's function.php file you will need to create a filter using the gform_field_value_$parameter_name hook: &#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_field_value_$parameter_name&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_field_value_$parameter_name&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;It will look like the following:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_field_value_refurl&#38;quot;, &#38;quot;referral_url&#38;quot;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;As you can see, I used the parameter name that I put in above (refurl). &#60;/p&#62;
&#60;p&#62;#2 - Next we will need to code the referral_url function to grab the URL and then put it into the hidden field.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function referral_url($form){
	//Grab URL from HTTP Server Var and put it into a variable
	$refurl = $_SERVER[&#38;#39;HTTP_REFERER&#38;#39;];

	//Return that value to the form
	return esc_url_raw($refurl);
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;FINAL NOTES&#60;br /&#62;
Now, if everything has been done correctly, when the form is loaded, the function will be called to grab the referral page and put the value into a hidden field. Then when you look at your entries, you should see which page lead them to your form.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>silverscape on "Capture http referrer url in hidden field"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/capture-http-referrer-url-in-hidden-field#post-59155</link>
			<pubDate>Wed, 16 May 2012 11:13:21 +0000</pubDate>
			<dc:creator>silverscape</dc:creator>
			<guid isPermaLink="false">59155@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I wish to capture the url of the referring url prior to landing on the form page.&#60;/p&#62;
&#60;p&#62;I note that there is a merge field called 'embed url' but oddly no 'referral url' which I would think would be a standard, powerful feature of Gravity forms?&#60;/p&#62;
&#60;p&#62;This suggests there is some additional coding / jquery to do in the headers etc which I am reluctant to do :)&#60;/p&#62;
&#60;p&#62;Can anyone provide a step-by-step dummy proof mechanism to capture the referral url in my existing form without jumping through too many hoops?&#60;/p&#62;
&#60;p&#62;Thanks so much&#60;br /&#62;
J
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
