- This topic has 4 replies, 4 voices, and was last updated 4 years, 8 months ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › WP Affiliate Platform › WP Affiliate Tweaks › Populating Gravity Form Field with the Affiliate ID
Hello,
I have setup Gravity Forms and WP Affiliate for Lead Capture and it works perfectly.
I would like to take this one step further and populate a Gravity Form Hidden Field with the Affiliate ID.
Any input would be appreciated.
Thanks Jason
You can access the referrer ID from the affiliate plugin using the following line of code:
$referrer_id = $_COOKIE['ap_id'];
Use this value inside the function that will handle the Gravity form action to populate the field. You will need to read Gravity forms documentation to learn how to populate a form field programatically.
Thanks, I’ll give that a try.
Jason
Hello,
Just checking in if this code is still valid in 2020. I contacted Gravity Forms who gave me a code with this line in order to populate the field with a referrer ID. But no luck.
I see this is 7 years old, perhaps there is another way to do it now?