Insider API
Learn how to send your Hardal analytics data to Insider API using Custom API connections
Connecting Hardal Analytics to Insider API
Overview
This guide explains how to integrate Hardal Analytics with Insider’s API using Hardal’s Custom API connections. By setting up this integration, you can automatically send user events, attributes, and other analytics data collected through Hardal directly to Insider’s Unified Customer Database (UCD).
This integration uses Insider’s Upsert User Data API, which allows you to send both user attributes and events from Hardal, enabling seamless data synchronization between platforms.
Prerequisites
Before setting up the integration, ensure you have:
-
A Hardal account with tracking implemented on your website or application
-
Access to Hardal’s Marketing Destinations section
-
An Insider account with API access
-
API credentials from Insider:
-
Partner Name (visible on the dropdown menu next to your username)
-
Request Token (API key) from Insider’s Integration Settings
-
Setting Up a Custom API Connection in Hardal
Access Marketing Destinations
-
Log into your Hardal dashboard
-
Navigate to “Connections”
-
Click “Add Destination”
Select Custom API Template
-
From the template options, select “Custom API”
-
Click “Create” to begin configuring the connection
Configure Basic Connection Settings
Set up the following basic connection parameters:
Setting | Value |
---|---|
Endpoint Label | Insider Integration |
Endpoint ID | insider-integration |
Endpoint URL | https://unification.useinsider.com/api/user/v1/upsert |
Request Method | POST |
Content Type | application/json |
Add Authentication Headers
Configure the required headers for Insider API authentication:
Make sure to use your actual Insider partner name (in lowercase) and API token. The partner name can be found in the dropdown next to your username on the Insider dashboard, and the API token can be generated in Integration Settings.
Configure Request Format
Set up the request format to properly map Hardal data to Insider’s expected format:
The above format uses Hardal variables (enclosed in ##
) that will be automatically populated with data from your events. You can customize this mapping based on your specific data structure.
Set Up Event Conditions (Optional)
You can set up conditions to control which events are sent to Insider:
-
Click on “Add Condition”
-
Select the condition type (e.g., “Event Name”)
-
Choose the operator (e.g., “equals”, “contains”)
-
Enter the value (e.g., “purchase” to only send purchase events)
You can create multiple connections with different conditions to send different types of events with customized formats.
Test the Connection
-
Click the “Test Endpoint” button to validate your configuration
-
Check the response to ensure it’s successful
-
If you receive any errors, adjust your configuration and test again
Save and Activate
-
Once testing is successful, click “Save” to create the connection
-
Toggle the connection to “Active” to start sending data
Special Event Configuration for Insider
Insider’s API requires specific formatting for different event types. Below are examples for common events:
Purchase Event
For purchase events, you need to include additional parameters like event_group_id
and unit_sale_price
:
User Registration Event
For user registration events:
Handling Common Insider API Requirements
Required Parameters for Purchase Events
When sending purchase events to Insider, ensure these parameters are included:
-
event_group_id
: Required for purchase events (typically an order ID) -
unit_sale_price
: Required for purchase events (the price after discounts) -
currency
: Required for purchase events (in ISO 4217 format, e.g., “USD”)
Formatting Timestamps
Insider requires timestamps in RFC 3339 format. Hardal’s ##created_at##
variable outputs in this format, but if you’re manipulating dates, ensure they follow this pattern: YYYY-MM-DDThh:mm:ssZ
or with timezone offset YYYY-MM-DDThh:mm:ss±hh:mm
.
Handling Array Attributes
By default, when sending array attributes for a user, Insider adds new values to existing ones. If you want to replace array attributes instead of appending, add "not_append": true
to your request:
Troubleshooting
Example: Complete Custom Connection Configuration
Here’s a complete example of a Custom API configuration for sending both user attributes and purchase events to Insider:
Headers Configuration
Request Body Configuration
When working with the Hardal Custom API, the variable placeholders (like ##user.email##
) will be automatically replaced with the actual values when an event is processed. Make sure all variable references match the exact names of your Hardal attributes and properties.
Best Practices
-
Start with critical events: Begin by sending high-value events like purchases and registrations before expanding to other event types.
-
Monitor data quality: Regularly check both Hardal and Insider dashboards to ensure data is flowing correctly.
-
Use skip_hook for historical data: When sending historical data, set
skip_hook: true
to prevent triggering current journeys. -
Batch users efficiently: Each request can include up to 1,000 users, but keep request size under 5MB.
-
Handle errors properly: Implement proper error logging and retry mechanisms for failed requests.
-
Test thoroughly: Always test your connection with various event types before fully deploying.
-
Maintain data consistency: Ensure identifiers and event parameters are consistent across platforms.