Skip to main content

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.
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
});

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
});
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");

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
  }]
});

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
  }]
});

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
  }]
});

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"
});

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"
});

Fires when a user performs a site search.
hardal.track("search", {
  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
  }]
});

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
  }]
});

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
  }]
});

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
    }
  ]
});

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
  }]
});

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
  }]
});

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
  }]
});

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
    }
  ]
});

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
  }]
});

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"
});

sign_up

Fires when a user creates an account.
hardal.track("sign_up", {
  method: "Google"
});

login

Fires when a user logs in.
hardal.track("login", {
  method: "Email"
});

share

Fires when a user shares content.
hardal.track("share", {
  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"
});

trial_start

Fires when a user starts a free trial.
hardal.track("trial_start", {
  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
});

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"
});

tutorial_begin

Fires when a user begins a tutorial. No additional parameters.
hardal.track("tutorial_begin");

tutorial_complete

Fires when a user completes a tutorial. No additional parameters.
hardal.track("tutorial_complete");

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: "[email protected]",
  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.