<?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: How to capture the post ID of the referring page</title>
		<link>https://legacy.forums.gravityhelp.com/topic/how-to-capture-the-post-id-of-the-referring-page</link>
		<description>Gravity Support Forums Topic: How to capture the post ID of the referring page</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 15:15:17 +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/how-to-capture-the-post-id-of-the-referring-page" rel="self" type="application/rss+xml" />

		<item>
			<title>Carl Hancock on "How to capture the post ID of the referring page"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-capture-the-post-id-of-the-referring-page#post-2533</link>
			<pubDate>Fri, 08 Jan 2010 13:08:31 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">2533@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Nice!  Glad to see people bending Gravity Forms to their will... if you take advantage of the hooks and the dynamic variables like in this example, you can do so much with it.  Most people only scratch the surface of what is possible.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "How to capture the post ID of the referring page"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-capture-the-post-id-of-the-referring-page#post-2530</link>
			<pubDate>Fri, 08 Jan 2010 13:03:42 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">2530@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Worked brilliantly.  I added a conditional to account for someone accessing the page with the embedded form directly (without the postid there), but other than that , this worked straight away.  One more form plugin replaced by Gravity.  Thanks
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "How to capture the post ID of the referring page"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-capture-the-post-id-of-the-referring-page#post-2507</link>
			<pubDate>Thu, 07 Jan 2010 16:52:03 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">2507@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You can accomplish what you want to do in two steps.&#60;/p&#62;
&#60;p&#62;1- Display the referrer post title in your form's description (assumes &#34;postid&#34; is passed in the querystring)&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;//Adds post title to form description
add_filter(&#38;quot;gform_pre_render_18&#38;quot;, &#38;quot;populate_description&#38;quot;);
function populate_description($form_meta){
    $form_meta[&#38;quot;description&#38;quot;] = &#38;quot;Regarding: &#38;quot; . get_the_title($_GET[&#38;quot;postid&#38;quot;]);
    return $form_meta;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Note: You will need to replace _18 with your actual form id.&#60;/p&#62;
&#60;p&#62;2- Send the referrer URL in the notification&#60;br /&#62;
You can do that by adding a hidden field to your form and populating it's default value (advanced tab) with the variable &#34;HTTP Referrer URL&#34;&#60;br /&#62;
From there, you can select that hidden field as a variable in your notification emails like any other field.&#60;/p&#62;
&#60;p&#62;I think this is all you need. Let me know how it goes.&#60;br /&#62;
Good Luck.&#60;br /&#62;
Alex.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "How to capture the post ID of the referring page"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-capture-the-post-id-of-the-referring-page#post-2506</link>
			<pubDate>Thu, 07 Jan 2010 16:21:38 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">2506@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;I have multiple motorcycle listings on my website, and for all of them I link to one contact form (using easy contact right now, which I have modified.)  In any case, I would like to display the title of the Page when they land on the contact form (i.e. &#34;Regarding: 2008 Specific Motorcycle&#34;) and I was doing that in the past by using WordPress queryvars.  I'm trying to go from 3 form plugins down to one: I've already removed one, and Easy Contact is the other one.&#60;/p&#62;
&#60;p&#62;So, what is the best way to do what I need here: I would like the Gravity contact form, when they land on it, to know what Page the click came from, and then also send the URL of that page in the email notification.&#60;/p&#62;
&#60;p&#62;If none of that makes sense, see these pages for the way it works now:&#60;/p&#62;
&#60;p&#62;[linkrot]&#60;/p&#62;
&#60;p&#62;The &#34;Request more information&#34; link is a link to the contact form, and it looks like this:&#60;br /&#62;
[linkrot]&#60;/p&#62;
&#60;p&#62;3676 is the ID of that Page.  When that ID goes to the contact form, I can use queryvars and determine the URL (permalink) and the Title of the page (which is displayed above the form.  Here's the code I use in functions.php:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;// add a query var for the postid to send to the contact form
add_filter(&#38;#39;query_vars&#38;#39;, &#38;#39;parameter_queryvars&#38;#39; );
function parameter_queryvars( $qvars ) {
        $qvars[] = &#38;#39;postid&#38;#39;;
        return $qvars;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;and the modification to the Easy Contact plugin:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;// grab the postid if it was sent as a query var
global $wp_query;
if (isset($wp_query-&#38;gt;query_vars[&#38;#39;postid&#38;#39;])) {
	$postID = $wp_query-&#38;gt;query_vars[&#38;#39;postid&#38;#39;];
	$form .= &#38;quot;\n\t&#38;lt;p&#38;gt;&#38;lt;strong&#38;gt;Regarding&#38;lt;/strong&#38;gt;: &#38;quot; . get_the_title($postID) . &#38;quot;&#38;lt;/p&#38;gt;&#38;quot;;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I'm sure I made this sound more complicated than it really is, and there's probably a really easy way to do this with GF that I have overlooked.&#60;/p&#62;
&#60;p&#62;I was using Joost's referrer plugin for GF, but that appended ALL the site visit history as referrers to the email notifications, and when employees respond to the contact, they don't always think to remove all that data, so the response to the customer has 20 or 50 or 300 URLs that they visited.  Not cool.  So, I stopped using that.  If I can recreate what I have with Easy Contact now, using GF, I will dump yet another form plugin.&#60;/p&#62;
&#60;p&#62;If you want to test the Easy Contact form for some reason, please feel free to do so, just put TEST somewhere in the name fields. &#60;/p&#62;
&#60;p&#62;Hope that makes sense.  Thank you.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
