Referral Code in From Submission

Our current “Non-Wordpress” website has a referral code system where we provide people a URL like “” If someone clicks that link to our website, the “dref=ABC123” is stored as a cookie & if they end up submitting a form on our site that information is relayed within the form submission so we know where they came from.

I am building the new site in Wordpress & using Gravity Forms to handle all form submissions, is there something already out there that would allow me to do this easier or will I need to do something custom to work with the cookies.

Thanks for any assistance!

You can do that in Gravity Forms without the cookie. You can set up a field to be populated dynamically, and use the parameter name ‘dref’. When someone follows that link to your site the value of dref is stored in the form field. This explains how it’s done:

If you have any questions, please let us know.


Does that work even if they don’t land directly on the form & submit a request right there. What if it’s just a link to our site & they view 15 pages before submitting the quote request?


That will only work if they come to the form directly from the link. If you want to store it in a cookie when they arrive at your site, with that link, you can do that. Setting the cookie is not Gravity Forms functionality (you can use PHP or JavaScript to do that.)

Once you have stored that value in a cookie, you can read the value from the cookie and set the field value this manner:

Awesome! I’ll poke around some more with this & start testing out retrieving the cookie & populating the form with that data.

Thanks for the help!

1 Like