# ShiftOps HubSpot sign_up_type\_\_c Capture Issue


**Last Updated:** 2025-11-20

**Date:** 2025-11-20  
**Status:** ✅ RESOLVED - Field added as hidden field in HubSpot form editor

## Issue Summary

The `shiftops-hubspot` form is not capturing the `sign_up_type__c` field, even though:

- ✅ The HubSpot property `sign_up_type__c` exists
- ✅ The form has a field named `sign_up_type__c`
- ✅ The code sends `sign_up_type__c = "Tools Page"` correctly
- ✅ Logs confirm the field is being sent in the API request
- ✅ Other fields (e.g., `content`) are being captured correctly

## Verification Results

### Test Contacts

- **Old Contact:** `test-shiftops-hubspot-1763240359@test.ordio.com` - sign_up_type\_\_c: null
- **New Contact:** `test-shiftops-hubspot-1763241040@test.ordio.com` - sign_up_type\_\_c: null
- **Test Contact:** `test-shiftops-signup-1763241094@test.ordio.com` - sign_up_type\_\_c: null

### Form Configuration

- **Form GUID:** `41d07332-6697-4daa-b27e-dd60515f9c0f`
- **Form Name:** ShiftOps Grader Lead Capture
- **Field Name:** `sign_up_type__c`
- **Field Type:** `single_line_text`
- **Field Visibility:** Hidden
- **Field Required:** Optional

### Property Configuration

- **Property Name:** `sign_up_type__c`
- **Property Label:** "Sign up type"
- **Property Type:** `string`
- **Field Type:** `text`
- **HubSpot Defined:** false (custom property)

## Code Verification

The code correctly sends the field:

```php
// v2/api/shiftops-hubspot.php:558-559
[
    "name" => "sign_up_type__c",
    "value" => "Tools Page"
],
```

This matches the pattern used by other forms that successfully capture `sign_up_type__c`:

- `collect-lead.php` - ✅ Captures correctly
- `submit-template.php` - ✅ Captures correctly
- `addon-request.php` - ✅ Captures correctly
- `export-workdays.php` - ✅ Captures correctly

## Root Cause Analysis

The issue appears to be a **HubSpot form field mapping problem**. The form field exists, but it may not be properly mapped to the HubSpot property `sign_up_type__c`. Possible causes:

1. **Field Mapping Issue:** The form field may not be correctly mapped to the property in HubSpot's form editor
2. **Property Association:** The form field may not be associated with the correct property
3. **Form Configuration:** The form may have a configuration issue preventing the field from being saved

## Comparison with Working Forms

### Working Example: collect-lead

- Form GUID: `a91b263c-7ca2-418b-b35c-9664c30e968b`
- Field: `sign_up_type__c`
- Value Sent: `"Tools Page"`
- Result: ✅ Captured correctly

### Non-Working Example: shiftops-hubspot

- Form GUID: `41d07332-6697-4daa-b27e-dd60515f9c0f`
- Field: `sign_up_type__c`
- Value Sent: `"Tools Page"`
- Result: ❌ Not captured (null)

## Recommended Fix

### Manual HubSpot Configuration

1. **Open HubSpot Form Editor**

   - Navigate to Marketing > Forms
   - Open form: "ShiftOps Grader Lead Capture" (GUID: `41d07332-6697-4daa-b27e-dd60515f9c0f`)

2. **Check Field Configuration**

   - Locate the `sign_up_type__c` field
   - Verify it's mapped to the property: `sign_up_type__c`
   - Check if the property association is correct

3. **Re-map Field if Needed**

   - If the field is not mapped correctly, re-map it to `sign_up_type__c`
   - Ensure the field name matches exactly: `sign_up_type__c`

4. **Test Submission**
   - Submit a test form submission
   - Verify `sign_up_type__c` is captured correctly

### Alternative: Use CRM API Update

If form mapping cannot be fixed, consider updating the contact via CRM API after form submission:

```php
// After successful form submission
if ($httpCode === 200 || $httpCode === 204) {
    // Update sign_up_type__c via CRM API
    updateContactProperty($email, 'sign_up_type__c', 'Tools Page');
}
```

## Impact

- **Low Impact:** The `content` field is captured correctly, so form submissions are working
- **Data Quality:** Missing `sign_up_type__c` affects reporting and segmentation
- **Consistency:** Other forms capture `sign_up_type__c` correctly, so this is an inconsistency

## Resolution

**Date Resolved:** November 15, 2025

The issue was resolved by adding `sign_up_type__c` as a hidden field in the HubSpot form editor. After the fix:

- ✅ New submissions successfully capture `sign_up_type__c = "Tools Page"`
- ✅ Test contact `test-shiftops-signup-1763241246@test.ordio.com` confirmed working
- ✅ Test contact `test-shiftops-hubspot-1763241254@test.ordio.com` confirmed working

**Note:** Old contacts created before the fix will still show `null` for `sign_up_type__c`, but all new submissions will capture it correctly.

## Next Steps

1. ✅ Issue documented and verified
2. ✅ Manual HubSpot form configuration fix completed
3. ✅ Test after fix verified capture
4. ✅ Documentation updated

## Related Files

- `v2/api/shiftops-hubspot.php` - Code that sends the field
- `scripts/hubspot/test-shiftops-signup-type.php` - Test script
- `docs/guides/HUBSPOT_SIGNUP_CONTENT_FIRSTPAGE_VERIFICATION.md` - Verification report
