Segmentify Integration

Overview

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.

Prerequisites

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.

Understanding Segmentify API Requirements

Segmentify uses a RESTful API that accepts various event types to track user behavior and personalize content. Key concepts to understand:

Segmentify Event Types

Event NameDescriptionSegmentify Event Type
Page ViewWhen a user views a pagePAGE_VIEW
Product ViewWhen a user views a productPRODUCT_VIEW
Basket OperationsAdding/removing products from basketBASKET_OPERATIONS
CheckoutVarious checkout stepsCHECKOUT
User OperationsUser login, signup, etc.USER_OPERATIONS
Custom EventAny custom user actionCUSTOM_EVENT

Authentication Requirements

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

Setting Up Custom API Destination in Hardal

1

Access Marketing Destinations

  1. Log into your Hardal dashboard

  2. Navigate to Connections

  3. Click “Add Destination”

  4. Select “Custom API” from the template options

2

Configure Base Settings

Configure the basic destination settings:

{
  "endpoint_label": "Segmentify Integration",
  "endpoint_id": "segmentify-integration",
  "endpoint_url": "https://[YOUR-DATA-CENTER].segmentify.com/add/events/v1.json?apiKey=[YOUR-API-KEY]",
  "request_method": "POST",
  "content_type": "application/json"
}

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.

3

Add Required Headers

Configure the headers required by Segmentify:

{
  "headers": {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Origin": "https://yourdomain.com"
  }
}

Replace https://yourdomain.com with your actual website domain.

Mapping Hardal Events to Segmentify Format

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.

Mapping Page View Events

1

Create Event Mapping

Configure the request format for page view events:

{
  "request_format": [
    {
      "name": "PAGE_VIEW",
      "userId": "##user_id##",
      "sessionId": "##session_id##",
      "device": "##device_type##",
      "pageUrl": "##page.url##",
      "referrer": "##page.referrer##",
      "category": "##properties.page_category##",
      "subCategory": "##properties.page_subcategory##"
    }
  ]
}

This maps Hardal’s variables (marked with ##variable##) to Segmentify’s expected format.

2

Set Up Condition

Add a condition to trigger this mapping only for page view events:

  1. In the “Conditions” section, click “Add Condition”

  2. 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.

Mapping Product View Events

Product views are crucial for Segmentify’s recommendation engine.

1

Create Event Mapping

Configure the request format for product view events:

{
  "request_format": [
    {
      "name": "PRODUCT_VIEW",
      "userId": "##user_id##",
      "sessionId": "##session_id##",
      "device": "##device_type##",
      "productId": "##properties.product_id##",
      "title": "##properties.product_name##",
      "url": "##page.url##",
      "image": "##properties.product_image##",
      "category": "##properties.product_category##",
      "brand": "##properties.product_brand##",
      "price": ##properties.product_price##,
      "inStock": "##properties.product_in_stock##"
    }
  ]
}
2

Set Up Condition

Add a condition where “Event Name” equals “product_view”.

Mapping Add to Cart Events

For basket operations like adding products to cart:

1

Create Event Mapping

{
  "request_format": [
    {
      "name": "BASKET_OPERATIONS",
      "userId": "##user_id##",
      "sessionId": "##session_id##",
      "device": "##device_type##",
      "step": "add",
      "productId": "##properties.product_id##",
      "price": ##properties.product_price##,
      "quantity": ##properties.quantity##
    }
  ]
}
2

Set Up Condition

Add a condition where “Event Name” equals “add_to_cart”.

Mapping Remove from Cart Events

For basket operations like removing products from cart:

1

Create Event Mapping

{
  "request_format": [
    {
      "name": "BASKET_OPERATIONS",
      "userId": "##user_id##",
      "sessionId": "##session_id##",
      "device": "##device_type##",
      "step": "remove",
      "productId": "##properties.product_id##",
      "quantity": ##properties.quantity##
    }
  ]
}
2

Set Up Condition

Add a condition where “Event Name” equals “remove_from_cart”.

Mapping Checkout Events

Checkout events in Segmentify track the conversion funnel with multiple steps.

Mapping User Operations

User operations help Segmentify personalize experiences based on user identity.

Testing the Integration

1

Validate Configuration

Before activating your integration, validate your configuration:

  1. Wait a while for Hardal to send some events

  2. Check Segmentify for events received

2

Monitor Events in Segmentify

  1. Log into your Segmentify dashboard

  2. Check the “Real-time Events” section

  3. Verify that events from Hardal are being received correctly

3

Test Full Conversion Flow

Conduct a complete test from page view through purchase:

  1. Browse your website while monitoring events

  2. View a product

  3. Add it to cart

  4. Complete a test purchase

  5. Verify each step is tracked in Segmentify

4

Enable the Integration

Once testing is successful:

  1. Return to your Hardal Custom API destination settings

  2. Click “Save Changes”

  3. Monitor the event flow for a few days to ensure stability

Troubleshooting

Best Practices

Data Consistency

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

Performance Optimization

  • Group related events to minimize API calls

  • Implement proper error handling

  • Consider using batch processing for high-volume events

Security Considerations

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

Resources