Connect Hardal analytics to Segmentify for advanced personalization
This guide explains how to integrate Hardal analytics with Segmentify using Hardal’s Custom API destination feature. By connecting these platforms, you can use your first-party data collected through Hardal to power Segmentify’s personalization engine for product recommendations, search optimization, and engagement campaigns.
Before setting up the integration, ensure you have:
An active Hardal account with tracking set up on your website
An active Segmentify account with API access
Your Segmentify API Key and Data Center URL
Basic understanding of both platforms and JSON
Proper integration requires admin access to both platforms. Make sure you have the necessary permissions before beginning.
Segmentify uses a RESTful API that accepts various event types to track user behavior and personalize content. Key concepts to understand:
Event Name | Description | Segmentify Event Type |
---|---|---|
Page View | When a user views a page | PAGE_VIEW |
Product View | When a user views a product | PRODUCT_VIEW |
Basket Operations | Adding/removing products from basket | BASKET_OPERATIONS |
Checkout | Various checkout steps | CHECKOUT |
User Operations | User login, signup, etc. | USER_OPERATIONS |
Custom Event | Any custom user action | CUSTOM_EVENT |
Segmentify requires an API key and specific headers for authentication:
API Key (included as a query parameter)
Content-Type: application/json
Accept: application/json
Origin: Your domain
Access Marketing Destinations
Log into your Hardal dashboard
Navigate to Connections
Click “Add Destination”
Select “Custom API” from the template options
Configure Base Settings
Configure the basic destination settings:
Replace [YOUR-DATA-CENTER]
and [YOUR-API-KEY]
with your actual Segmentify data center URL and API key. You can find these values in your Segmentify account under Settings > Integrations.
Add Required Headers
Configure the headers required by Segmentify:
Replace https://yourdomain.com
with your actual website domain.
The most important part of the integration is correctly mapping Hardal events to the expected Segmentify format. Segmentify expects an array of events in its request body.
Create a separate API destination for each event type you want to track in Segmentify to keep your configuration clean and organized.
Create Event Mapping
Configure the request format for page view events:
This maps Hardal’s variables (marked with ##variable##
) to Segmentify’s expected format.
Set Up Condition
Add a condition to trigger this mapping only for page view events:
In the “Conditions” section, click “Add Condition”
Set “Event Name” equals “page_view”
Make sure your Hardal implementation is sending the appropriate page category values with your page view events. Common values include “Home Page”, “Product Page”, “Category Page”, etc.
Product views are crucial for Segmentify’s recommendation engine.
Create Event Mapping
Configure the request format for product view events:
Set Up Condition
Add a condition where “Event Name” equals “product_view”.
For basket operations like adding products to cart:
Create Event Mapping
Set Up Condition
Add a condition where “Event Name” equals “add_to_cart”.
For basket operations like removing products from cart:
Create Event Mapping
Set Up Condition
Add a condition where “Event Name” equals “remove_from_cart”.
Checkout events in Segmentify track the conversion funnel with multiple steps.
View Basket Checkout Step
The product_list
should be an array of products in the format:
Customer Information Checkout Step
Payment Information Checkout Step
Purchase Completion Step
The orderNo
parameter is mandatory for purchase events and should be unique for each order to avoid duplicate tracking.
User operations help Segmentify personalize experiences based on user identity.
User Signup
For gender, Segmentify expects ‘M’ for male, ‘F’ for female, or ‘U’ for undefined.
User Login
User Logout
User Update
The segments
parameter should be an array of strings representing user segments, useful for targeting specific customer groups.
Validate Configuration
Before activating your integration, validate your configuration:
Wait a while for Hardal to send some events
Check Segmentify for events received
Monitor Events in Segmentify
Log into your Segmentify dashboard
Check the “Real-time Events” section
Verify that events from Hardal are being received correctly
Test Full Conversion Flow
Conduct a complete test from page view through purchase:
Browse your website while monitoring events
View a product
Add it to cart
Complete a test purchase
Verify each step is tracked in Segmentify
Enable the Integration
Once testing is successful:
Return to your Hardal Custom API destination settings
Click “Save Changes”
Monitor the event flow for a few days to ensure stability
Events Not Being Received
If events aren’t appearing in Segmentify:
Verify API Key and Data Center URL
Check the Origin header matches your domain
Ensure your Hardal events contain all required fields
Check the Hardal logs for any error responses
Invalid Event Format
If Segmentify returns “INVALID_EVENT” errors:
Check that your JSON format exactly matches Segmentify’s requirements
Verify that numeric fields are not wrapped in quotes
Ensure array fields are properly formatted as JSON arrays
Check for missing mandatory fields
Missing User or Session IDs
If you receive “NO_USERID” or “NO_SESSIONID” errors:
Verify that Hardal is correctly generating user_id and session_id values
Check that these values are being mapped in your request format
Consider implementing custom user ID generation if needed
Maintain consistent data formats between Hardal and Segmentify:
Use the same product IDs across all platforms
Ensure category hierarchies match between systems
Use consistent naming conventions for user attributes
Group related events to minimize API calls
Implement proper error handling
Consider using batch processing for high-volume events
Never expose your Segmentify API key in client-side code. The Hardal server-side integration ensures your key remains secure.
Regularly rotate your API keys
Implement IP restrictions if possible
Only send necessary data to minimize privacy concerns