Web Setup
Install the Hardal script on your website to auto-track page views and send e-commerce, lead generation, and custom conversion events
Installation
Add the Hardal script to your website using direct implementation or a Tag Manager.
Add to your HTML <head> section:
<script
defer
src="https://<your-signal-id>-signal.usehardal.com/hardal"
data-website-id="<your-signal-id>"
data-host-url="https://<your-signal-id>-signal.usehardal.com"
data-auto-track="true"
></script>
Replace <your-signal-id> with your Signal ID from Settings → Setup in the Hardal dashboard.
Create a Custom HTML tag
<script
defer
src="https://<your-signal-id>-signal.usehardal.com/hardal"
data-website-id="<your-signal-id>"
data-host-url="https://<your-signal-id>-signal.usehardal.com"
data-auto-track="true"
></script>
Configure and publish
Replace <your-signal-id> with your Signal ID, set the trigger for desired pages, and publish your GTM container.
With data-auto-track="true", the script automatically collects page_view events including URL, title, and referrer. You do not need to fire page_view manually.
Navigate to the related section for recommended events.
Sales Events
Track product views, cart actions, checkout steps, purchases, and refunds
Lead Events
Track form submissions, signups, logins, shares, subscriptions, and trials
Game Events
Track virtual currency, levels, scores, achievements, and tutorials
Identify
Link events to known users after login, signup, or consent
Event Schema
Use these templates to send any event to Hardal. Replace the event name and data fields with your own values.
hardal.track("your_event_name", {
your_field: "your_value",
another_field: 123
});
<script>
hardal.track("your_event_name", {
your_field: "your_value",
another_field: 123
});
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "your_event_name",
"url": "https://yourdomain.com/page",
"title": "Page Title",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {
"your_field": "your_value",
"another_field": 123
}
}
}'
Consent Parameter
Use consent parameter if you are planning to use Destinations for sending data to consent requiring endpoints; such as Ads channels.
hardal.track("your_event_name", {
your_field: "your_value",
another_field: 123,
consent: true
});
<script>
hardal.track("your_event_name", {
your_field: "your_value",
another_field: 123,
consent: true
});
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "your_event_name",
"url": "https://yourdomain.com/page",
"title": "Page Title",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {
"your_field": "your_value",
"another_field": 123,
"consent": true
}
}
}'
Consent is required for Destinations in Marketing category. This requirement might change due to your region and regulations.
Sales
page_view
Collected automatically by the Hardal script — no manual call needed. Listed here for reference when sending via API.
// Automatically collected — no code needed.
// Only call manually if data-auto-track is disabled:
hardal.track("page_view");
<script>
// Automatically collected — no code needed.
// Only call manually if data-auto-track is disabled:
hardal.track("page_view");
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "page_view",
"url": "https://store.example.com/category/shoes",
"title": "Shoes",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {}
}
}'
view_item
Fires when a user views a product detail page.
hardal.track("view_item", {
currency: "USD",
value: 89.99,
items: [{
item_id: "RUN-AIR-42",
item_name: "AirStride Running Shoes",
item_brand: "TrailForce",
item_category: "Footwear",
item_category2: "Running",
price: 89.99,
quantity: 1
}]
});
<script>
hardal.track("view_item", {
currency: "USD",
value: 89.99,
items: [{
item_id: "RUN-AIR-42",
item_name: "AirStride Running Shoes",
item_brand: "TrailForce",
item_category: "Footwear",
item_category2: "Running",
price: 89.99,
quantity: 1
}]
});
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "view_item",
"url": "https://store.example.com/product/airstride-running-shoes",
"title": "AirStride Running Shoes",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {
"currency": "USD",
"value": 89.99,
"items": [{
"item_id": "RUN-AIR-42",
"item_name": "AirStride Running Shoes",
"item_brand": "TrailForce",
"item_category": "Footwear",
"item_category2": "Running",
"price": 89.99,
"quantity": 1
}]
}
}
}'
view_item_list
Fires when a user views a list of products (category page, search results).
hardal.track("view_item_list", {
item_list_id: "bestsellers",
item_list_name: "Bestsellers",
items: [{
item_id: "BOOK-1984",
item_name: "Atomic Habits",
item_brand: "Penguin",
item_category: "Books",
item_category2: "Self-Help",
price: 14.99,
quantity: 1,
index: 0
}]
});
<script>
hardal.track("view_item_list", {
item_list_id: "bestsellers",
item_list_name: "Bestsellers",
items: [{
item_id: "BOOK-1984",
item_name: "Atomic Habits",
item_brand: "Penguin",
item_category: "Books",
item_category2: "Self-Help",
price: 14.99,
quantity: 1,
index: 0
}]
});
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "view_item_list",
"url": "https://store.example.com/bestsellers",
"title": "Bestsellers",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {
"item_list_id": "bestsellers",
"item_list_name": "Bestsellers",
"items": [{
"item_id": "BOOK-1984",
"item_name": "Atomic Habits",
"item_brand": "Penguin",
"item_category": "Books",
"item_category2": "Self-Help",
"price": 14.99,
"quantity": 1,
"index": 0
}]
}
}
}'
select_item
Fires when a user clicks a product from a list.
hardal.track("select_item", {
item_list_id: "search_results",
item_list_name: "Search Results",
items: [{
item_id: "LAP-PRO-16",
item_name: "ProBook 16 Laptop",
item_brand: "NovaTech",
item_category: "Electronics",
item_category2: "Laptops",
price: 1249.00,
quantity: 1,
index: 2
}]
});
<script>
hardal.track("select_item", {
item_list_id: "search_results",
item_list_name: "Search Results",
items: [{
item_id: "LAP-PRO-16",
item_name: "ProBook 16 Laptop",
item_brand: "NovaTech",
item_category: "Electronics",
item_category2: "Laptops",
price: 1249.00,
quantity: 1,
index: 2
}]
});
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "select_item",
"url": "https://store.example.com/search?q=laptop",
"title": "Search: laptop",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {
"item_list_id": "search_results",
"item_list_name": "Search Results",
"items": [{
"item_id": "LAP-PRO-16",
"item_name": "ProBook 16 Laptop",
"item_brand": "NovaTech",
"item_category": "Electronics",
"item_category2": "Laptops",
"price": 1249.00,
"quantity": 1,
"index": 2
}]
}
}
}'
view_promotion
Fires when a user views a promotion (banner, offer).
hardal.track("view_promotion", {
promotion_id: "PROMO_BF2025",
promotion_name: "Black Friday 2025",
creative_name: "blackfriday_hero",
creative_slot: "homepage_banner"
});
<script>
hardal.track("view_promotion", {
promotion_id: "PROMO_BF2025",
promotion_name: "Black Friday 2025",
creative_name: "blackfriday_hero",
creative_slot: "homepage_banner"
});
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "view_promotion",
"url": "https://store.example.com",
"title": "Home",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {
"promotion_id": "PROMO_BF2025",
"promotion_name": "Black Friday 2025",
"creative_name": "blackfriday_hero",
"creative_slot": "homepage_banner"
}
}
}'
select_promotion
Fires when a user clicks a promotion.
hardal.track("select_promotion", {
promotion_id: "PROMO_BF2025",
promotion_name: "Black Friday 2025",
creative_name: "blackfriday_hero",
creative_slot: "homepage_banner"
});
<script>
hardal.track("select_promotion", {
promotion_id: "PROMO_BF2025",
promotion_name: "Black Friday 2025",
creative_name: "blackfriday_hero",
creative_slot: "homepage_banner"
});
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "select_promotion",
"url": "https://store.example.com",
"title": "Home",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {
"promotion_id": "PROMO_BF2025",
"promotion_name": "Black Friday 2025",
"creative_name": "blackfriday_hero",
"creative_slot": "homepage_banner"
}
}
}'
search
Fires when a user performs a site search.
hardal.track("search", {
search_term: "bluetooth speaker"
});
<script>
hardal.track("search", {
search_term: "bluetooth speaker"
});
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "search",
"url": "https://store.example.com/search?q=bluetooth+speaker",
"title": "Search Results",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {
"search_term": "bluetooth speaker"
}
}
}'
add_to_cart
Fires when a user adds an item to their cart.
hardal.track("add_to_cart", {
currency: "USD",
value: 59.99,
items: [{
item_id: "EAR-WIRE-BLK",
item_name: "SoundPods Wireless Earbuds",
item_brand: "AudioWave",
item_category: "Electronics",
item_category2: "Audio",
price: 59.99,
quantity: 1
}]
});
<script>
hardal.track("add_to_cart", {
currency: "USD",
value: 59.99,
items: [{
item_id: "EAR-WIRE-BLK",
item_name: "SoundPods Wireless Earbuds",
item_brand: "AudioWave",
item_category: "Electronics",
item_category2: "Audio",
price: 59.99,
quantity: 1
}]
});
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "add_to_cart",
"url": "https://store.example.com/product/soundpods-wireless",
"title": "SoundPods Wireless Earbuds",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {
"currency": "USD",
"value": 59.99,
"items": [{
"item_id": "EAR-WIRE-BLK",
"item_name": "SoundPods Wireless Earbuds",
"item_brand": "AudioWave",
"item_category": "Electronics",
"item_category2": "Audio",
"price": 59.99,
"quantity": 1
}]
}
}
}'
remove_from_cart
Fires when a user removes an item from their cart.
hardal.track("remove_from_cart", {
currency: "USD",
value: 12.99,
items: [{
item_id: "CASE-SLM-CLR",
item_name: "SlimGuard Clear Phone Case",
item_brand: "ShieldTech",
item_category: "Accessories",
item_category2: "Phone Cases",
price: 12.99,
quantity: 1
}]
});
<script>
hardal.track("remove_from_cart", {
currency: "USD",
value: 12.99,
items: [{
item_id: "CASE-SLM-CLR",
item_name: "SlimGuard Clear Phone Case",
item_brand: "ShieldTech",
item_category: "Accessories",
item_category2: "Phone Cases",
price: 12.99,
quantity: 1
}]
});
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "remove_from_cart",
"url": "https://store.example.com/cart",
"title": "Cart",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {
"currency": "USD",
"value": 12.99,
"items": [{
"item_id": "CASE-SLM-CLR",
"item_name": "SlimGuard Clear Phone Case",
"item_brand": "ShieldTech",
"item_category": "Accessories",
"item_category2": "Phone Cases",
"price": 12.99,
"quantity": 1
}]
}
}
}'
add_to_wishlist
Fires when a user adds an item to their wishlist.
hardal.track("add_to_wishlist", {
currency: "USD",
value: 299.00,
items: [{
item_id: "WATCH-FIT-44",
item_name: "PulseFit Smartwatch 44mm",
item_brand: "VivaGear",
item_category: "Wearables",
item_category2: "Smartwatches",
item_variant: "midnight_black",
price: 299.00,
quantity: 1
}]
});
<script>
hardal.track("add_to_wishlist", {
currency: "USD",
value: 299.00,
items: [{
item_id: "WATCH-FIT-44",
item_name: "PulseFit Smartwatch 44mm",
item_brand: "VivaGear",
item_category: "Wearables",
item_category2: "Smartwatches",
item_variant: "midnight_black",
price: 299.00,
quantity: 1
}]
});
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "add_to_wishlist",
"url": "https://store.example.com/product/pulsefit-smartwatch",
"title": "PulseFit Smartwatch 44mm",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {
"currency": "USD",
"value": 299.00,
"items": [{
"item_id": "WATCH-FIT-44",
"item_name": "PulseFit Smartwatch 44mm",
"item_brand": "VivaGear",
"item_category": "Wearables",
"item_category2": "Smartwatches",
"item_variant": "midnight_black",
"price": 299.00,
"quantity": 1
}]
}
}
}'
view_cart
Fires when a user views their cart.
hardal.track("view_cart", {
currency: "USD",
value: 174.98,
items: [
{
item_id: "HP-STUDIO-7",
item_name: "Studio 7 Headphones",
item_brand: "AudioWave",
item_category: "Electronics",
item_category2: "Audio",
price: 129.99,
quantity: 1
},
{
item_id: "KB-MECH-TKL",
item_name: "ClickForce TKL Keyboard",
item_brand: "TypeCraft",
item_category: "Electronics",
item_category2: "Peripherals",
price: 44.99,
quantity: 1
}
]
});
<script>
hardal.track("view_cart", {
currency: "USD",
value: 174.98,
items: [
{
item_id: "HP-STUDIO-7",
item_name: "Studio 7 Headphones",
item_brand: "AudioWave",
item_category: "Electronics",
item_category2: "Audio",
price: 129.99,
quantity: 1
},
{
item_id: "KB-MECH-TKL",
item_name: "ClickForce TKL Keyboard",
item_brand: "TypeCraft",
item_category: "Electronics",
item_category2: "Peripherals",
price: 44.99,
quantity: 1
}
]
});
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "view_cart",
"url": "https://store.example.com/cart",
"title": "Cart",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {
"currency": "USD",
"value": 174.98,
"items": [
{
"item_id": "HP-STUDIO-7",
"item_name": "Studio 7 Headphones",
"item_brand": "AudioWave",
"item_category": "Electronics",
"item_category2": "Audio",
"price": 129.99,
"quantity": 1
},
{
"item_id": "KB-MECH-TKL",
"item_name": "ClickForce TKL Keyboard",
"item_brand": "TypeCraft",
"item_category": "Electronics",
"item_category2": "Peripherals",
"price": 44.99,
"quantity": 1
}
]
}
}
}'
begin_checkout
Fires when a user begins checkout.
hardal.track("begin_checkout", {
currency: "EUR",
value: 549.00,
coupon: "WELCOME10",
items: [{
item_id: "CAM-MIRR-X5",
item_name: "LensPro X5 Mirrorless Camera",
item_brand: "OpticVision",
item_category: "Electronics",
item_category2: "Cameras",
price: 549.00,
quantity: 1
}]
});
<script>
hardal.track("begin_checkout", {
currency: "EUR",
value: 549.00,
coupon: "WELCOME10",
items: [{
item_id: "CAM-MIRR-X5",
item_name: "LensPro X5 Mirrorless Camera",
item_brand: "OpticVision",
item_category: "Electronics",
item_category2: "Cameras",
price: 549.00,
quantity: 1
}]
});
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "begin_checkout",
"url": "https://store.example.com/checkout",
"title": "Checkout",
"device_type": "desktop",
"language": "de-DE",
"platform": "web",
"data": {
"currency": "EUR",
"value": 549.00,
"coupon": "WELCOME10",
"items": [{
"item_id": "CAM-MIRR-X5",
"item_name": "LensPro X5 Mirrorless Camera",
"item_brand": "OpticVision",
"item_category": "Electronics",
"item_category2": "Cameras",
"price": 549.00,
"quantity": 1
}]
}
}
}'
add_shipping_info
Fires when a user submits shipping information during checkout.
hardal.track("add_shipping_info", {
currency: "GBP",
value: 189.00,
coupon: "FREESHIP",
shipping_tier: "Next-day",
items: [{
item_id: "COF-BREW-DLX",
item_name: "BrewMaster Deluxe Coffee Machine",
item_brand: "BeanTech",
item_category: "Home & Kitchen",
item_category2: "Coffee Machines",
price: 189.00,
quantity: 1
}]
});
<script>
hardal.track("add_shipping_info", {
currency: "GBP",
value: 189.00,
coupon: "FREESHIP",
shipping_tier: "Next-day",
items: [{
item_id: "COF-BREW-DLX",
item_name: "BrewMaster Deluxe Coffee Machine",
item_brand: "BeanTech",
item_category: "Home & Kitchen",
item_category2: "Coffee Machines",
price: 189.00,
quantity: 1
}]
});
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "add_shipping_info",
"url": "https://store.example.com/checkout/shipping",
"title": "Shipping",
"device_type": "desktop",
"language": "en-GB",
"platform": "web",
"data": {
"currency": "GBP",
"value": 189.00,
"coupon": "FREESHIP",
"shipping_tier": "Next-day",
"items": [{
"item_id": "COF-BREW-DLX",
"item_name": "BrewMaster Deluxe Coffee Machine",
"item_brand": "BeanTech",
"item_category": "Home & Kitchen",
"item_category2": "Coffee Machines",
"price": 189.00,
"quantity": 1
}]
}
}
}'
add_payment_info
Fires when a user submits payment information during checkout.
hardal.track("add_payment_info", {
currency: "USD",
value: 349.99,
coupon: "GAMER15",
payment_type: "Credit Card",
items: [{
item_id: "MON-GAME-27",
item_name: "PixelEdge 27" Gaming Monitor",
item_brand: "ViewMax",
item_category: "Electronics",
item_category2: "Monitors",
price: 349.99,
quantity: 1
}]
});
<script>
hardal.track("add_payment_info", {
currency: "USD",
value: 349.99,
coupon: "GAMER15",
payment_type: "Credit Card",
items: [{
item_id: "MON-GAME-27",
item_name: "PixelEdge 27" Gaming Monitor",
item_brand: "ViewMax",
item_category: "Electronics",
item_category2: "Monitors",
price: 349.99,
quantity: 1
}]
});
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "add_payment_info",
"url": "https://store.example.com/checkout/payment",
"title": "Payment",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {
"currency": "USD",
"value": 349.99,
"coupon": "GAMER15",
"payment_type": "Credit Card",
"items": [{
"item_id": "MON-GAME-27",
"item_name": "PixelEdge 27" Gaming Monitor",
"item_brand": "ViewMax",
"item_category": "Electronics",
"item_category2": "Monitors",
"price": 349.99,
"quantity": 1
}]
}
}
}'
purchase
Fires when a user completes a purchase.
hardal.track("purchase", {
transaction_id: "ORD-20250615-7891",
value: 214.98,
currency: "USD",
tax: 17.20,
shipping: 5.99,
coupon: "SUMMER20",
items: [
{
item_id: "JKT-WIND-M",
item_name: "StormShield Windbreaker",
item_brand: "PeakWear",
item_category: "Apparel",
item_category2: "Jackets",
item_variant: "navy_blue",
price: 79.99,
quantity: 1,
discount: 16.00
},
{
item_id: "SNK-URBAN-10",
item_name: "UrbanGlide Sneakers",
item_brand: "StepUp",
item_category: "Footwear",
item_category2: "Sneakers",
item_variant: "white_grey",
price: 134.99,
quantity: 1
}
]
});
<script>
hardal.track("purchase", {
transaction_id: "ORD-20250615-7891",
value: 214.98,
currency: "USD",
tax: 17.20,
shipping: 5.99,
coupon: "SUMMER20",
items: [
{
item_id: "JKT-WIND-M",
item_name: "StormShield Windbreaker",
item_brand: "PeakWear",
item_category: "Apparel",
item_category2: "Jackets",
item_variant: "navy_blue",
price: 79.99,
quantity: 1,
discount: 16.00
},
{
item_id: "SNK-URBAN-10",
item_name: "UrbanGlide Sneakers",
item_brand: "StepUp",
item_category: "Footwear",
item_category2: "Sneakers",
item_variant: "white_grey",
price: 134.99,
quantity: 1
}
]
});
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "purchase",
"url": "https://store.example.com/order/confirmation",
"title": "Order Confirmed",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {
"transaction_id": "ORD-20250615-7891",
"value": 214.98,
"currency": "USD",
"tax": 17.20,
"shipping": 5.99,
"coupon": "SUMMER20",
"items": [
{
"item_id": "JKT-WIND-M",
"item_name": "StormShield Windbreaker",
"item_brand": "PeakWear",
"item_category": "Apparel",
"item_category2": "Jackets",
"item_variant": "navy_blue",
"price": 79.99,
"quantity": 1,
"discount": 16.00
},
{
"item_id": "SNK-URBAN-10",
"item_name": "UrbanGlide Sneakers",
"item_brand": "StepUp",
"item_category": "Footwear",
"item_category2": "Sneakers",
"item_variant": "white_grey",
"price": 134.99,
"quantity": 1
}
]
}
}
}'
refund
Fires when a user receives a refund. Include items for item-level refund reporting.
hardal.track("refund", {
transaction_id: "ORD-20250615-7891",
value: 134.99,
currency: "USD",
tax: 10.80,
items: [{
item_id: "SNK-URBAN-10",
item_name: "UrbanGlide Sneakers",
item_brand: "StepUp",
item_category: "Footwear",
item_category2: "Sneakers",
price: 134.99,
quantity: 1
}]
});
<script>
hardal.track("refund", {
transaction_id: "ORD-20250615-7891",
value: 134.99,
currency: "USD",
tax: 10.80,
items: [{
item_id: "SNK-URBAN-10",
item_name: "UrbanGlide Sneakers",
item_brand: "StepUp",
item_category: "Footwear",
item_category2: "Sneakers",
price: 134.99,
quantity: 1
}]
});
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "refund",
"url": "https://store.example.com/order/ORD-20250615-7891",
"title": "Refund",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {
"transaction_id": "ORD-20250615-7891",
"value": 134.99,
"currency": "USD",
"tax": 10.80,
"items": [{
"item_id": "SNK-URBAN-10",
"item_name": "UrbanGlide Sneakers",
"item_brand": "StepUp",
"item_category": "Footwear",
"item_category2": "Sneakers",
"price": 134.99,
"quantity": 1
}]
}
}
}'
Leads
generate_lead
Fires when a user submits a lead form or inquiry.
hardal.track("generate_lead", {
lead_id: "LEAD-12345",
currency: "USD",
value: 500,
lead_source: "Trade show",
name: "John Doe",
category: "Enterprise",
type: "demo_request",
label: "Summer Campaign",
country: "US",
city: "San Francisco",
district: "California"
});
<script>
hardal.track("generate_lead", {
lead_id: "LEAD-12345",
currency: "USD",
value: 500,
lead_source: "Trade show",
name: "John Doe",
category: "Enterprise",
type: "demo_request",
label: "Summer Campaign",
country: "US",
city: "San Francisco",
district: "California"
});
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "generate_lead",
"url": "https://example.com/contact",
"title": "Contact Us",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {
"lead_id": "LEAD-12345",
"currency": "USD",
"value": 500,
"lead_source": "Trade show",
"name": "John Doe",
"category": "Enterprise",
"type": "demo_request",
"label": "Summer Campaign",
"country": "US",
"city": "San Francisco",
"district": "California"
}
}
}'
sign_up
Fires when a user creates an account.
hardal.track("sign_up", {
method: "Google"
});
<script>
hardal.track("sign_up", {
method: "Google"
});
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "sign_up",
"url": "https://example.com/register",
"title": "Sign Up",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {
"method": "Google"
}
}
}'
login
Fires when a user logs in.
hardal.track("login", {
method: "Email"
});
<script>
hardal.track("login", {
method: "Email"
});
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "login",
"url": "https://example.com/login",
"title": "Login",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {
"method": "Email"
}
}
}'
share
Fires when a user shares content.
hardal.track("share", {
method: "WhatsApp",
content_type: "product",
item_id: "RUN-AIR-42"
});
<script>
hardal.track("share", {
method: "WhatsApp",
content_type: "product",
item_id: "RUN-AIR-42"
});
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "share",
"url": "https://store.example.com/product/airstride-running-shoes",
"title": "AirStride Running Shoes",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {
"method": "WhatsApp",
"content_type": "product",
"item_id": "RUN-AIR-42"
}
}
}'
subscribe
Fires when a user subscribes to a list or notifications.
hardal.track("subscribe", {
list_name: "Weekly Deals",
list_id: "NL_DEALS_01"
});
<script>
hardal.track("subscribe", {
list_name: "Weekly Deals",
list_id: "NL_DEALS_01"
});
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "subscribe",
"url": "https://store.example.com/newsletter",
"title": "Subscribe",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {
"list_name": "Weekly Deals",
"list_id": "NL_DEALS_01"
}
}
}'
trial_start
Fires when a user starts a free trial.
hardal.track("trial_start", {
plan: "business",
trial_days: 30,
value: 79.00,
currency: "USD"
});
<script>
hardal.track("trial_start", {
plan: "business",
trial_days: 30,
value: 79.00,
currency: "USD"
});
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "trial_start",
"url": "https://example.com/pricing",
"title": "Start Trial",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {
"plan": "business",
"trial_days": 30,
"value": 79.00,
"currency": "USD"
}
}
}'
Games
earn_virtual_currency
Fires when a user earns virtual currency (coins, gems, tokens).
hardal.track("earn_virtual_currency", {
virtual_currency_name: "StarCoins",
value: 150
});
<script>
hardal.track("earn_virtual_currency", {
virtual_currency_name: "StarCoins",
value: 150
});
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "earn_virtual_currency",
"url": "https://game.example.com/reward",
"title": "Reward",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {
"virtual_currency_name": "StarCoins",
"value": 150
}
}
}'
spend_virtual_currency
Fires when a user spends virtual currency.
hardal.track("spend_virtual_currency", {
virtual_currency_name: "StarCoins",
value: 75,
item_name: "Dragon Shield"
});
<script>
hardal.track("spend_virtual_currency", {
virtual_currency_name: "StarCoins",
value: 75,
item_name: "Dragon Shield"
});
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "spend_virtual_currency",
"url": "https://game.example.com/shop",
"title": "Shop",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {
"virtual_currency_name": "StarCoins",
"value": 75,
"item_name": "Dragon Shield"
}
}
}'
tutorial_begin
Fires when a user begins a tutorial. No additional parameters.
hardal.track("tutorial_begin");
<script>
hardal.track("tutorial_begin");
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "tutorial_begin",
"url": "https://game.example.com/tutorial",
"title": "Tutorial",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {}
}
}'
tutorial_complete
Fires when a user completes a tutorial. No additional parameters.
hardal.track("tutorial_complete");
<script>
hardal.track("tutorial_complete");
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "event",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "tutorial_complete",
"url": "https://game.example.com/tutorial",
"title": "Tutorial Complete",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {}
}
}'
Identify
distinct
Fires when a user logs in, signs up, or gives consent for processing personal information. Links all subsequent events to a known user profile.
hardal.distinct({
email: "alex@example.com",
firstName: "Alex",
lastName: "Rivera",
customerId: "USR_8827",
phone: 14155551234,
birthday: "1990-01-15",
gender: "male",
city: "San Francisco",
state: "CA",
zip: "94107",
country: "US"
});
<script>
hardal.distinct({
email: "alex@example.com",
firstName: "Alex",
lastName: "Rivera",
customerId: "USR_8827",
phone: 14155551234,
birthday: "1990-01-15",
gender: "male",
city: "San Francisco",
state: "CA",
zip: "94107",
country: "US"
});
</script>
curl -X POST https://signal.yourdomain.com/push/hardal \
-H "Content-Type: application/json" \
-d '{
"type": "identify",
"payload": {
"website": "YOUR_WEBSITE_ID",
"name": "distinct",
"url": "https://example.com/account",
"title": "Account",
"device_type": "desktop",
"language": "en-US",
"platform": "web",
"data": {
"email": "alex@example.com",
"firstName": "Alex",
"lastName": "Rivera",
"customerId": "USR_8827",
"phone": 14155551234,
"birthday": "1990-01-15",
"gender": "male",
"city": "San Francisco",
"state": "CA",
"zip": "94107",
"country": "US"
}
}
}'
Item Object
Used by view_item, view_item_list, select_item, add_to_cart, remove_from_cart, add_to_wishlist, view_cart, begin_checkout, add_shipping_info, add_payment_info, purchase, and refund.
view_item, add_to_cart, and purchase must send the same item details for accurate funnel reporting.
Unique product identifier. Example: RUN-AIR-42
Product name. Example: AirStride Running Shoes
Brand name. Example: TrailForce
Primary category. Example: Footwear
Unit price. Use discounted price if applicable. Example: 89.99
Quantity. Defaults to 1. Example: 2