• Resolved Serefor

    (@serefor)


    Hello!

    I have a site with SliceWP and Gravity Forms. Through the integration of Gravity Forms with Hubspot I can send all the form data to the CRM contacts. In addition to that data I want to send the referral URL or the affiliate’s username so I can know who referred that lead and have all the complete data. Is there any way to do this?

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author iova.mihai

    (@iovamihai)

    Hey @serefor,

    Thank you for reaching out! I believe that this can be done via a hidden input field and some custom code.

    Here’s the code:

    function slicewp_custom_add_gravity_forms_field_value_affiliate( $value ) {
    	
    	if ( ! function_exists( 'slicewp_get_referrer_affiliate_id' ) ) {
    		return $value;
    	}
    	
        $affiliate = slicewp_get_affiliate( slicewp_get_referrer_affiliate_id() );
    	
    	if ( is_null( $affiliate ) ) {
    		return $value;
    	}
    	
    	$user = get_userdata( $affiliate->get( 'user_id' ) );
    	
    	$value = $user->user_login; // Value will be set to the user's username.
    	
    	return $value;
    	
    }
    add_filter( 'gform_field_value_affiliate', 'slicewp_custom_add_gravity_forms_field_value_affiliate' );

    The code uses a hook provided by Gravity Forms (you can read more about this hook here: https://docs.gravityforms.com/gform_field_value_parameter_name/) to add the username of the affiliate user to a hidden field.

    To have the value appear in the hidden field, make sure to have the “Allow field to be populated dynamically” option checked in the field editor’s advanced tab.

    Also, make sure to set the “Parameter Name” option to “affiliate”.

    Please try it out and let me know how it goes.

    Thank you and best wishes,

    Mihai

    • This reply was modified 1 year, 4 months ago by iova.mihai.
    Thread Starter Serefor

    (@serefor)

    Hello @iovamihai,

    The code works perfectly!

    Thank you so much for your speedy and generous help. I couldn’t have done it without your support.

    You saved my day.

    Many congratulations for this amazing plugin.

    Regards!

    Serefor

    Plugin Author iova.mihai

    (@iovamihai)

    Hey @serefor,

    I’m really happy to hear the code worked as you need it! Happy I could help you.

    Also, thank you for the kind words about SliceWP!

    Considering that you’re enjoying the plugin, if it’s not too much to ask, could you please leave a review for SliceWP on the WordPress plugin directory (here: https://www.ads-software.com/support/plugin/slicewp/reviews/)?

    Thank you and best wishes,

    Mihai

    Thread Starter Serefor

    (@serefor)

    Hey @iovamihai,

    Of course I did! I left a fully deserved review.

    Thanks again!

    Serefor

    Plugin Author iova.mihai

    (@iovamihai)

    Hey @serefor,

    Glad I could help you out.

    Thank you so much for taking the time to write this review! I really appreciated!

    Best wishes,

    Mihai

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Send referral link to Hubspot trough Gravity Forms’ is closed to new replies.