Tips and Tricks HQ Support Portal › Forums › WP Affiliate Platform › WP Affiliate F.A.Q/Instructions › Gravity Forms Integration with the Affiliate Platform Plugin
Tagged: Gravity Forms, wufoo
- This topic has 6 replies, 5 voices, and was last updated 12 years, 5 months ago by admin.
-
AuthorPosts
-
November 5, 2010 at 3:43 pm #2173axellonlineMember
I use http://www.gravityforms.com/ to collect my data. Is it possible to use Gravity forms to capture leads just like you have with Contact Form 7?
Thanks again for your help. You are the best…I really do mean that..
Ed
November 6, 2010 at 1:06 am #26158amin007ParticipantEssentially it is a contact form plugin so it should be doable but because gravity forms is a premium plugin we can’t just start hacking that plugin.
We just need a hook that allows us to execute a bit of PHP code after the “Submit” button is clicked on the form. Maybe Gravity forms has an option to do this.
Can you please ask the gravity form guys if they have an option where we can add an action or hook so that when the “Submit” button is clicked on the form it will send us the submitted info to our action function? This will allow us to capture the lead after someone hits the “submit” button on the contact form.
November 8, 2010 at 1:07 am #26159axellonlineMemberThanks. I will ask.
November 16, 2010 at 11:46 am #26160westcowebMemberHi I have just posted this on the GF forum as well; please give the following solution a try.
a) The GF form needs a minimum of three required fields:
e-mail address for the lead
hidden field to capture client IP
hidden field to capture unique id capable of being dynamically populated (I called mine unique_id)
b) Shortcut to invoke form and pass unique id (in case you want to call form from multiple places on your website)
[gravityform id=12 title=false description=false field_values=’unique_id=1′]
c) Following code to go into functions.php – replace form id with your GF form reference number and field numbers for the three $_POST’s.
// November 2010 MJB - Add For Gravity Forms Post Submission
function gf_post_submission($entry, $form){
// Only Execute For Form 12 - Lead Capture
if($form['id'] != 12) return $form;
//Check For Presence Of Cookie ap_id
$aff_id = $_COOKIE['ap_id'];
if(!empty($aff_id))
{
// Build Lead Table Entries
$reference = $_POST["input_14"]; //Unique ID
$clientdate = (date ("Y-m-d"));
$clienttime = (date ("H:i:s"));
$buyer_email = $_POST["input_3"]; //Email
$ipaddress = $_POST["input_12"]; // Client IP Address
global $wpdb;
$affiliates_leads_table_name = $wpdb->prefix . "affiliates_leads_tbl";
$updatedb = "INSERT INTO $affiliates_leads_table_name (buyer_email,refid,reference,date,time,ipaddress) VALUES ('$buyer_email','$aff_id','$reference','$clientdate','$clienttime','$ipaddress')";
$results = $wpdb->query($updatedb);
}
}
add_action("gform_post_submission", "gf_post_submission", 10, 2);
// End Addition For Gravity FormsTested this morning and works for me…adding entries into the GF form and wp-affiliates Lead Gen table.
Michael.
November 17, 2010 at 2:01 am #26161amin007ParticipantThank you for posting the solution Michael.
June 24, 2012 at 5:54 pm #26162sarnorealroiMemberhi we have our own contact plugin – which we can add php code to send the lead to your affiliate code. Can you elaborate on what we need to do?
Thank You
June 24, 2012 at 11:44 pm #26163adminKeymasterYou posted the same question on another thread here:
-
AuthorPosts
- You must be logged in to reply to this topic.