Viewing 3 replies - 1 through 3 (of 3 total)
  • I’ve never been able to get this to work with cookies and would love to know how you manage it if you do!

    However, maybe this function could be of use to you? It uses the URL but…

    add_filter( 'salesforce_w2l_field_value', 'salesforce_w2l_field_value_querystring_gclid', 10, 3 );
    
    function salesforce_w2l_field_value_querystring_gclid( $val, $field, $form ){
    
        $form_ids = array(2, 4, 1); // form id to act upon
        $field_name = '00N0O00000A9mrA'; // API Name of the field you want to autofill
        $qs_var = 'gclid'; // gclid
    
        if( in_array($form, $form_ids ) && $field_name == $field ){
            if( isset( $_GET[ $qs_var ] ) ){
                return $_GET[ $qs_var ];
            }
        }
    
        return $val;
    
    }
    Plugin Author Nick Ciske

    (@nickciske)

    Google Analytics cookies are Javascript based… so PHP doesn’t have access to them.

    You’d need to retrieve the value and fill the field via JS before form submission to capture that.

    Thread Starter rgrauphics

    (@rgrauphics)

    Thank you @mrcairney – Will take a look to see if that passes any information from the advertising avenue to SF.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘GCLID not showing up in Salesforce’ is closed to new replies.