<?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: integrate wp affiliate platform for pay per lead commission</title>
		<link>https://legacy.forums.gravityhelp.com/topic/integrate-wp-affiliate-platform-for-pay-per-lead-commission</link>
		<description>Gravity Support Forums Topic: integrate wp affiliate platform for pay per lead commission</description>
		<language>en-US</language>
		<pubDate>Mon, 06 Apr 2026 08:33:12 +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/integrate-wp-affiliate-platform-for-pay-per-lead-commission" rel="self" type="application/rss+xml" />

		<item>
			<title>robgranholm on "integrate wp affiliate platform for pay per lead commission"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/integrate-wp-affiliate-platform-for-pay-per-lead-commission#post-55430</link>
			<pubDate>Mon, 16 Apr 2012 19:32:43 +0000</pubDate>
			<dc:creator>robgranholm</dc:creator>
			<guid isPermaLink="false">55430@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi! &#60;/p&#62;
&#60;p&#62;I've read through this forum posting a few times and can't seem to find a place to start to dig in. I'm looking to use the Affiliate Platform plugin with Gravity Forms and the PayPal addon to track sales, can sunstardave or Michael possibly help me out...is there a *complete* version of the instructions somewhere so I can start hacking away at this to get this working on my forms? &#60;/p&#62;
&#60;p&#62;Gravity Forms is already heads above anything else out there for flexible integrations into a website, I just haven't been able to find an affiliate platform to bolt on, getting this working would be huge!&#60;/p&#62;
&#60;p&#62;Much thanks!&#60;/p&#62;
&#60;p&#62;-r
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sunstardave on "integrate wp affiliate platform for pay per lead commission"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/integrate-wp-affiliate-platform-for-pay-per-lead-commission#post-22224</link>
			<pubDate>Fri, 01 Apr 2011 08:41:44 +0000</pubDate>
			<dc:creator>sunstardave</dc:creator>
			<guid isPermaLink="false">22224@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks very much for such a detailed breakdown. It really helped and everything is working great.&#60;/p&#62;
&#60;p&#62;Thanks again!!&#60;/p&#62;
&#60;p&#62;David
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "integrate wp affiliate platform for pay per lead commission"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/integrate-wp-affiliate-platform-for-pay-per-lead-commission#post-22159</link>
			<pubDate>Thu, 31 Mar 2011 11:14:32 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">22159@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;@sunstardave The &#34;Default Value&#34; area isn't for dynamically populating with custom code.  It's purely for either a static Default Value *OR* using the Insert Form Field drop down that inserts a form field variable.  It isn't used for populating a field using PHP or the query string.  The only values that go in the Default Value is one you manually type in OR a variable from the Insert Form Field drop down that appears with that field.&#60;/p&#62;
&#60;p&#62;As for populating a field dynamically... the parameter field is up to you.  What goes in the parameter field is the parameter you want to use to dynamically populate that field.  You decide that.  The parameter name is then used to target that field either with PHP using the gform_field_value hook OR via the query string by passing the value to the page containing the form (ex. mydomain.com/mypage?parameter=value).  The parameter in the querystring would be whatever you chose, so if you set the parameter for an email field to &#34;email&#34; then you could pass data to it via PHP or the query strin g(ex. mydomain.com/mypage?email=email@email.com).  Documentation for the gform_field_value hook is here:&#60;/p&#62;
&#60;p&#62;&#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;Step 2: Again, you would pass the parameter names for the field you want to populate this way.  The parameter names are whatever you configured for each field.  For example if you gave an email field the parameter name of email you would pre-populate it like so:&#60;br /&#62;
[gravityform id=12 title=false description=false field_values='email=email@email.com']&#60;/p&#62;
&#60;p&#62;So for example.  If I edited an email field on my form, selected the Advanced tab and checked the &#34;Allow field to be populated dynamically&#34; tab and then gave it a parameter name of &#34;email&#34; (without the quotes) like so: &#60;a href=&#34;http://grab.by/9LWP&#34; rel=&#34;nofollow&#34;&#62;http://grab.by/9LWP&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I could then populate that field dynamically via PHP using the gform_field_value hook, or via the query string by passing it (ex. mydomain.com/mypage?email=email@email.com) or via the shortcode ([gravityform id=12 title=false description=false field_values='email=email@email.com']).&#60;/p&#62;
&#60;p&#62;Your Step 3, yes the code would go in functions.php and the form id would be the form id for the form you want to customize.  The field numbers are the input id numbers for the fields which you can find by viewing source on your form and getting the input name which will look something like &#34;input_2&#34; or &#34;input_3&#34;, etc. the number is the field id.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sunstardave on "integrate wp affiliate platform for pay per lead commission"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/integrate-wp-affiliate-platform-for-pay-per-lead-commission#post-22150</link>
			<pubDate>Thu, 31 Mar 2011 07:53:21 +0000</pubDate>
			<dc:creator>sunstardave</dc:creator>
			<guid isPermaLink="false">22150@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks for putting these instructions up.&#60;/p&#62;
&#60;p&#62;I wasn't sure whether or not to start another topic or piggy back on this one so I hope the later is OK.&#60;/p&#62;
&#60;p&#62;Although I understand what is generally needed, I am lost on a few points:&#60;/p&#62;
&#60;p&#62;By the way, I’m using caps for clarity. I’m not shouting. :o )&#60;/p&#62;
&#60;p&#62;STEP 1)&#60;br /&#62;
* e-mail address for the lead ~ NO PROBLEM&#60;br /&#62;
* hidden field to capture client IP (default value) ~ NO PROBLEM&#60;br /&#62;
* hidden field to capture unique id capable of being dynamically populated (I called mine unique_id) ~ THE HIDDEN FIELD HAS AN ADVANCED TAB WHICH DISPLAYS:&#60;/p&#62;
&#60;p&#62;A section: “Default Value” (dropdown) with “Insert Variable” as the default which has a blank field by default under it. WHICH VALUE IS SELECTED WHAT GOES IN THE FIELD?&#60;/p&#62;
&#60;p&#62;A section: “Allow field to be populated dynamically” (checkbox) and when checked, which is what we want, the following appears:&#60;/p&#62;
&#60;p&#62;A section: “Parameter Name:” with a blank field. WHAT GOES IN THIS FIELD?&#60;/p&#62;
&#60;p&#62;STEP 2)&#60;br /&#62;
Shortcut to invoke form and pass unique id (in case you want to call form from multiple places on your website)&#60;/p&#62;
&#60;p&#62;[gravityform id=12 title=false description=false field_values='unique_id=1']&#60;br /&#62;
I’M AFRAID I DON’T UNDERSTAND THIS AT ALL. WHAT DO I NEED TO CREATE/EDIT/ADD AND WHERE?&#60;/p&#62;
&#60;p&#62;STEP 3)&#60;br /&#62;
Following code to go into “functions.php” file of your theme (NO PROBLEM) – replace form id with your own form reference number (I ASSUME THIS IS JUST THE FORM ID AND NOT SOME DIFFERENT REFERENCE NUMBER FOUND OR CREATED ELSEWHERE) and replace the field numbers for the three $_POST’s (WHAT ARE THEY REPLACED WITH?).&#60;/p&#62;
&#60;p&#62;I would be really grateful for any advice.&#60;/p&#62;
&#60;p&#62;Thanks,&#60;br /&#62;
David
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "integrate wp affiliate platform for pay per lead commission"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/integrate-wp-affiliate-platform-for-pay-per-lead-commission#post-20369</link>
			<pubDate>Thu, 10 Mar 2011 16:58:05 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">20369@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;@Scott You would have to contact the WP Affiliate Platform Plugin people are far as this custom code goes or the site where you got it from.  We didn't write it, so it's not code we are familiar with as far as support goes.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Scott on "integrate wp affiliate platform for pay per lead commission"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/integrate-wp-affiliate-platform-for-pay-per-lead-commission#post-20368</link>
			<pubDate>Thu, 10 Mar 2011 16:54:56 +0000</pubDate>
			<dc:creator>Scott</dc:creator>
			<guid isPermaLink="false">20368@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thank you for your reply. I am a newbie here struggling through this. Here is the code base I am using.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;CODE BEGIN
// November 2010 MJB - Add For Gravity Forms Post Submission
function gf_post_submission($entry, $form){
// Only Execute For Form 12 - Lead Capture
if($form[&#38;#39;id&#38;#39;] != 12) return $form;
//Check For Presence Of Cookie ap_id
$aff_id = $_COOKIE[&#38;#39;ap_id&#38;#39;];
if(!empty($aff_id))
{
// Build Lead Table Entries
$reference = $_POST[&#38;quot;input_14&#38;quot;]; //Unique ID
$clientdate = (date (&#38;quot;Y-m-d&#38;quot;));
$clienttime = (date (&#38;quot;H:i:s&#38;quot;));
$buyer_email = $_POST[&#38;quot;input_3&#38;quot;]; //Email
$ipaddress = $_POST[&#38;quot;input_12&#38;quot;]; // Client IP Address
global $wpdb;
$affiliates_leads_table_name = $wpdb-&#38;gt;prefix . &#38;quot;affiliates_leads_tbl&#38;quot;;
$updatedb = &#38;quot;INSERT INTO $affiliates_leads_table_name (buyer_email,refid,reference,date,time,ipaddress) VALUES (&#38;#39;$buyer_email&#38;#39;,&#38;#39;$aff_id&#38;#39;,&#38;#39;$reference&#38;#39;,&#38;#39;$clientdate&#38;#39;,&#38;#39;$clienttime&#38;#39;,&#38;#39;$ipaddress&#38;#39;)&#38;quot;;
$results = $wpdb-&#38;gt;query($updatedb);
}
}
add_action(&#38;quot;gform_post_submission&#38;quot;, &#38;quot;gf_post_submission&#38;quot;, 10, 2);
// End Addition For Gravity Forms&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I have three forms that I want to track:&#60;br /&#62;
gravityform id=7&#60;br /&#62;
gravityform id=6&#60;br /&#62;
gravityform id=2&#60;/p&#62;
&#60;p&#62;Each form has different fields. When I made some changes to what I THOUGHT I should do, it didn't work and the site returned a blank page. I would GREATLY appreciate it if you could help me.&#60;/p&#62;
&#60;p&#62;Also, I you could spare some of your knowledge, in the instructions located here - &#60;a href=&#34;http://www.tipsandtricks-hq.com/wordpress-affiliate/gravity-forms-and-wp-affiliate-platform-integration-385&#34; rel=&#34;nofollow&#34;&#62;http://www.tipsandtricks-hq.com/wordpress-affiliate/gravity-forms-and-wp-affiliate-platform-integration-385&#60;/a&#62;, I don't understand where the UNIQUE_ID comes into play. &#60;/p&#62;
&#60;p&#62;Thank you so much for your help!!!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "integrate wp affiliate platform for pay per lead commission"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/integrate-wp-affiliate-platform-for-pay-per-lead-commission#post-20367</link>
			<pubDate>Thu, 10 Mar 2011 16:12:12 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">20367@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You target a specific form in the filter call:&#60;/p&#62;
&#60;p&#62;add_action(&#34;gform_post_submission&#34;, &#34;gf_post_submission&#34;, 10, 2);&#60;/p&#62;
&#60;p&#62;In this call it is using gform_post_submission and if you do that it will be globally applied to all forms.&#60;/p&#62;
&#60;p&#62;If you want to target a specific form you would do:&#60;/p&#62;
&#60;p&#62;add_action(&#34;gform_post_submission_5&#34;, &#34;gf_post_submission&#34;, 10, 2);&#60;/p&#62;
&#60;p&#62;Notice the _5 on the end of gform_post_submission, that would target form id 5 and only form id 5.&#60;/p&#62;
&#60;p&#62;However in the example above the code that gets executed is gf_post_submission so you would have to do a different function call for each form.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Scott on "integrate wp affiliate platform for pay per lead commission"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/integrate-wp-affiliate-platform-for-pay-per-lead-commission#post-20366</link>
			<pubDate>Thu, 10 Mar 2011 16:07:12 +0000</pubDate>
			<dc:creator>Scott</dc:creator>
			<guid isPermaLink="false">20366@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;How do you configure this code to work for multiple forms? For example, we have three forms setup on the website and we want to track the referrals for each.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>AxellOnline on "integrate wp affiliate platform for pay per lead commission"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/integrate-wp-affiliate-platform-for-pay-per-lead-commission#post-12925</link>
			<pubDate>Thu, 18 Nov 2010 15:33:29 +0000</pubDate>
			<dc:creator>AxellOnline</dc:creator>
			<guid isPermaLink="false">12925@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Michael&#60;br /&#62;
You are the man! thanks for the solution!!!!!!&#60;/p&#62;
&#60;p&#62;i am having some trouble with the ip address coming in but in the grand scheme of things that isn't that big of an issue. &#60;/p&#62;
&#60;p&#62;Thank you so much
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Michael on "integrate wp affiliate platform for pay per lead commission"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/integrate-wp-affiliate-platform-for-pay-per-lead-commission#post-12749</link>
			<pubDate>Tue, 16 Nov 2010 07:11:14 +0000</pubDate>
			<dc:creator>Michael</dc:creator>
			<guid isPermaLink="false">12749@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;First of all a big thank you to the members of this forum for supplying a large number of code snippets; As I am not a PHP programmer I spent time browsing this forum to get the right PHP constructs for merging with elements of the wp-affilate code to create the following solution.&#60;/p&#62;
&#60;p&#62;a) The GF lead capture form needs the following three fields in place:&#60;br /&#62;
e-mail address for the lead&#60;br /&#62;
hidden field to capture client IP (default value)&#60;br /&#62;
hidden field to capture unique id capable of being dynamically populated (I called mine unique_id)&#60;/p&#62;
&#60;p&#62;b) Shortcut to invoke form and pass unique id (in case you want to call form from multiple places on your website)&#60;br /&#62;
[gravityform id=12 title=false description=false field_values='unique_id=1']&#60;/p&#62;
&#60;p&#62;c) Following code to go into functions.php - replace form id with your own form reference number and replace the field numbers for the three $_POST's.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;// November 2010 MJB - Add For Gravity Forms Post Submission
function gf_post_submission($entry, $form){
    // Only Execute For Form 12 - Lead Capture
    if($form[&#38;#39;id&#38;#39;] != 12) return $form;
    //Check For Presence Of Cookie ap_id
        $aff_id = $_COOKIE[&#38;#39;ap_id&#38;#39;];
        if(!empty($aff_id))
        {
// Build Lead Table Entries
	    $reference   = $_POST[&#38;quot;input_14&#38;quot;]; //Unique ID
            $clientdate  = (date (&#38;quot;Y-m-d&#38;quot;));
            $clienttime  = (date (&#38;quot;H:i:s&#38;quot;));
            $buyer_email = $_POST[&#38;quot;input_3&#38;quot;];  //Email
            $ipaddress   = $_POST[&#38;quot;input_12&#38;quot;]; // Client IP Address
            global $wpdb;
            $affiliates_leads_table_name = $wpdb-&#38;gt;prefix . &#38;quot;affiliates_leads_tbl&#38;quot;;
            $updatedb = &#38;quot;INSERT INTO $affiliates_leads_table_name (buyer_email,refid,reference,date,time,ipaddress) VALUES (&#38;#39;$buyer_email&#38;#39;,&#38;#39;$aff_id&#38;#39;,&#38;#39;$reference&#38;#39;,&#38;#39;$clientdate&#38;#39;,&#38;#39;$clienttime&#38;#39;,&#38;#39;$ipaddress&#38;#39;)&#38;quot;;
            $results = $wpdb-&#38;gt;query($updatedb);
        }
}
add_action(&#38;quot;gform_post_submission&#38;quot;, &#38;quot;gf_post_submission&#38;quot;, 10, 2);
// End Addition For Gravity Forms&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Tested this morning and works for me...adding entries into the GF form and wp-affiliates Lead Gen tables.&#60;/p&#62;
&#60;p&#62;Michael.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
