Stuck Solution

add_filter('gform_confirmation', 'dynamic_goaffpro_tracking', 10, 4); function dynamic_goaffpro_tracking($confirmation, $form, $entry, $ajax) { // Extract the EXACT charged amount from your system $charged_amount = floatval(rgar($entry, 'total_charged')); // Service type for contextual tracking $service_type = rgar($entry, 'service_type'); $goaffpro_order = [ 'id' => $entry['id'], 'number' => '#' . $entry['id'], 'total' => $charged_amount, // Direct from system, no preset calculation 'currency' => 'USD', 'date' => date('c'), 'customer' => [ 'first_name' => rgar($entry, 'first_name'), 'last_name' => rgar($entry, 'last_name'), 'email' => rgar($entry, 'email'), 'phone' => rgar($entry, 'phone') ], 'line_items' => [ [ 'name' => get_service_name($service_type), 'quantity' => 1, 'price' => $charged_amount ] ], 'forceSDK' => true ]; $tracking_script = ""; return $confirmation . $tracking_script; } function get_service_name($service_type) { // Mapping service types to readable names $services = [ 'tire_change' => 'Roadside Tire Change', 'jump_start' => 'Battery Jump Start', 'lockout' => 'Vehicle Lockout Service', 'fuel_delivery' => 'Emergency Fuel Delivery', 'towing' => 'Towing Service' ]; return $services[$service_type] ?? 'Roadside Assistance Service'; }

Thank you for booking with STUCK. Your roadside provider will be with you shortly.

Want to earn extra cash?!!! 

Want to earn extra cash while you wait for your roadside service? Fill out this form to help us market our services, and we pay you for every roadside booking acquired through your own dedicated social media link. It’s simple and takes about 30 seconds of your time. What do you have to lose?

AFFILIATE PROGRAM

Sign Up is Easy &  free

You’ll get 20% commission for each person that successfully request our service via your referral link. And our Affiliate Support Team will be happy to help provide any guidance or tips needed to help you grow

In just a few minutes, you’ll have a unique referral link. All you have to do is sign up, then click on AFFILIATE URLs to get your referral link.

START EARNING MONEY

Get 20% commission for each request.

There’s no limit to how much you can earn once you share your links. And our affiliate support team are always here to give personalized tips and advice.

MAXIMIZE YOUR EARNINGS

Target your customers, and get paid!

Use your referral links to segment your referred traffic, monitor how different activity performs and compare campaigns. Then use that knowledge to maximize your commissions. SETUP PAYOUTS TO YOU TO DELIVER YOUR COMMISSIONS

 

[affiliate_registration]
jQuery(document).bind('gform_confirmation_loaded', function(event, formId, entryId, formElement){ // Function to fetch form data function getFieldData(formId, fieldName) { var fieldValue = jQuery(formElement).find('input[name="input_' + fieldName + '"], select[name="input_' + fieldName + '"], textarea[name="input_' + fieldName + '"]').val(); return fieldValue ? fieldValue : 'N/A'; } // Collect form data var entryData = { orderId: entryId, totalAmount: getFieldData(formId, 'your_price_field_id'), // Replace 'your_price_field_id' with the actual field ID for price transactionId: getFieldData(formId, 'your_transaction_field_id'), // Replace with transaction field ID customerName: getFieldData(formId, 'your_name_field_id'), customerEmail: getFieldData(formId, 'your_email_field_id'), customerPhone: getFieldData(formId, 'your_phone_field_id'), vehicleInfo: { year: getFieldData(formId, 'year'), make: getFieldData(formId, 'make'), model: getFieldData(formId, 'model'), color: getFieldData(formId, 'color') }, location: { address: getFieldData(formId, 'address'), latitude: getFieldData(formId, 'latitude'), longitude: getFieldData(formId, 'longitude') } }; // Track the conversion using GoAffPro SDK try { Goaffpro('track-conversion', entryData); console.log('Conversion tracked successfully for entry:', entryId); } catch (error) { console.error('Failed to track conversion:', error); } });