Solution to tracking
-
For everyone who is having trouble making tracking work, you need to change the function of the 938 line for this one:
function _push_mautic_form( $query, $formId )
{
if( is_array( $query ) && ! empty( $query ) && is_numeric( $formId ) ) {
$ip = _get_ip();
$query[‘return’] = get_home_url();
$query[‘formId’] = $formId;
$data = array(
‘mauticform’ => $query,
);
if (isset($_COOKIE[‘mtc_id’]))
$data[‘mtc_id’] = $_COOKIE[‘mtc_id’];
$MauticBaseURL = get_option( ‘haw_mautic_base_url’ );
if ( $MauticBaseURL ) {
$url = $MauticBaseURL . “/form/submit?formId=” . $formId;
$response = wp_remote_post(
$url,
array(
‘method’ => ‘POST’,
‘timeout’ => 45,
‘headers’ => array(
‘X-Forwarded-For’ => $ip,
),
‘body’ => $data,
‘cookies’ => $_COOKIE
)
);
if ( is_wp_error( $response ) ) {
$error_message = $response->get_error_message();
error_log( “Gform_Mautic Error: $error_message” );
error_log( “posted url: $url” );
}
}
}
}
- The topic ‘Solution to tracking’ is closed to new replies.