As robust as Ninja Forms is, there does not seem to be a user-friendly way of passing cookie data in a field. Although it has been suggested to their dev team based on the comments here.

Don’t worry! The solution is not difficult.  I am going to assume you have already set the cookie you want to use.

Now you want to create a hidden field.


I have used ‘source’ as the Label.  Name yours appropriately.

Next, simply add the following code to your functions.php file:

add_filter( 'ninja_forms_render_default_value', 'my_change_nf_default_value', 10, 3 );
function my_change_nf_default_value( $default_value, $field_type, $field_settings ) {
if(strpos($field_settings['key'], 'source_') !== false){
$default_value = $_COOKIE['your_cookie_name'];
return $default_value;

You can see that I am filtering for a field_settings with a key name that includes the word ‘source_‘.  This is because I have several forms on my site.  I wanted to use this on all of them, and not have multi conditionals using the long string of numbers that follows ‘source_’.  It works perfectly fine.  Modify as needed.

Have questions or thoughts on this?  Let me know in the comments!