Adding Hum to Your Application
The Hum widget provides a seamless way to integrate internet service provider discovery into your website or application. With just a few lines of code, you can add a fully functional home internet service e-commerce experience that provides your users with address-specific plans, pricing, and service ordering capabilities.
Architecture
The Hum widget is built as a React single-page application using client-side rendering. It’s fully responsive and adapts smoothly to desktop, tablet, and mobile devices.The widget loads asynchronously and won’t block your page’s initial render performance.
Installation
Follow these steps to integrate the Hum widget into your application:1
Add the Widget Container
Add a container div with a specific ID where you want the widget to render:
You can customize the container ID, but make sure it matches the element you pass to the widget constructor.
2
Add the Widget Script
Include the Hum widget script in your HTML page:
The script loads asynchronously and is hosted on a CDN for optimal performance.
3
Initialize the Widget
Initialize the Hum widget instance with your API key and container element:
Verify the widget loads by checking your browser’s developer console for any error messages.
The
campaignId
parameter is optional and allows you to track unique information about the user, session, or campaign. Use this for attribution of widget interactions to specific marketing campaigns or sources. Hum provides session information via monthly CSV reports that include the campaignId
field for easy session and order attribution.Widget Layout Options
The Hum widget supports two different layout modes that you can configure during initialization:The checkout layout provides a fully responsive e-commerce experience, enabling your users to search, compare, and purchase internet service.Ideal for:
- Use cases where users may actively be seeking new or lower-cost internet service
- Dedicated pages within your app that can support the multi-step e-commerce experience
- New tenant/homeowner apps, mortgage apps, consumer finance apps and more

resultLayout
field during initialization:
If you don’t specify a layout, the widget defaults to the checkout layout.
Address Data Format
The widget expects address data in a specific JSON format. Here’s the structure:Required Fields
The primary street address. Should contain the street number and name.
The city name.
Two-letter state code (e.g., “MI” for Michigan).
The ZIP code in 5 or 9-digit format.
Optional Fields
Secondary address information such as apartment numbers, suite numbers, or additional address details.
Identifier for tracking purposes. Use this to associate widget interactions with specific marketing campaigns or sources. This campaign_id will be embedded in UTM parameters sent to the ISP and will be available in your Hum tracking.
Latitude coordinate for improved performance and reduced latency.
Longitude coordinate for improved performance and reduced latency.
Both latitude and longitude must be provided together. If only one is provided, the widget will return an error.
Integration Examples
Example 1: Form-Based Integration
This example shows how to integrate the widget with an HTML form for address input:index.html
Test your integration by entering a valid US address and verifying that service options load correctly.
Example 2: Direct JSON Integration
This example shows how to pass address data directly as a JSON object:direct-integration.html
Use the direct integration approach when you already have address data available, such as from a previous form submission or user profile.
Address Validation
The widget uses the same address validation rules as the API:Required Field Validation
Required Field Validation
- street1: Primary address (street number and name)
- city: Valid city name
- state: Valid 2-letter US state code
- zip: 5 or 9-digit ZIP code format (12345 or 12345-6789)
Optional Field Validation
Optional Field Validation
- street2: Unit/apartment information (no specific format required)
- campaign_id: Tracking identifier (no specific format required)
- latitude/longitude: Must be provided together and within US territorial bounds
Additional Validation Rules
Additional Validation Rules
- Address must be geocodable by our system
- Address must be serviceable by at least one provider
- Coordinates must be within the bounds of the US and its territories
Troubleshooting
Widget Not Loading
Widget Not Loading
Check these common issues:
- Verify the container div with ID ‘hum-widget’ exists on the page
- Ensure the widget script loads before your initialization code
- Check that your API key is valid and properly formatted
- Look for JavaScript errors in the browser console
hum.initialize()
.Address Validation Errors
Address Validation Errors
Common address issues:
- Ensure all required fields (street1, city, state, zip) are provided
- Verify the state is a valid 2-letter US state code
- Check that the ZIP code is in the correct format (12345 or 12345-6789)
- Make sure the address is a real, serviceable US address
Performance Issues
Performance Issues
Optimization tips:
- Include latitude and longitude coordinates when available
- Use the summary layout for faster loading when full e-commerce isn’t needed
- Ensure the widget script is loaded asynchronously
- Check network connectivity and CDN availability
Integration Problems
Integration Problems
Common integration issues:
- Verify the widget instance is stored globally if accessed by other scripts
- Check for conflicts with other JavaScript libraries
- Ensure proper error handling for failed API calls
- Verify the container element is visible and properly sized
If issues persist, check the browser console for detailed error messages and contact support with the specific error details.
Next Steps
Now that you have the Hum widget integrated, here are some recommended next steps:Test Your Integration
Verify your widget works correctly with different addresses and layouts.
API Reference
Explore advanced API features for deeper integration capabilities.
Live Demo
See the widget in action on the Hum website.
Get Support
Contact our team for integration assistance and technical support.
Additional Resources
Best Practices
Best Practices
- Always implement proper error handling for API calls
- Use loading states to improve user experience
- Test with various address formats and edge cases
- Consider using the summary layout for space-constrained interfaces
- Include campaign IDs for better tracking and attribution
Performance Tips
Performance Tips
- Load the widget script asynchronously when possible
- Include latitude/longitude coordinates for faster results
- Cache widget instances when using multiple widgets on the same page
- Monitor console logs during development for optimization opportunities
Common Use Cases
Common Use Cases
- Real Estate Platforms: Help users understand internet options before moving
- Property Management: Assist tenants in finding internet service
- Financial Services: Support mortgage and lending applications
- Moving Services: Provide comprehensive relocation assistance