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
});
Request type. Use "event" for events, "identify" for user identification.
Your Signal ID from the Hardal dashboard.
Event name. Any string you choose.
Page URL or screen identifier. Example: https://example.com/checkout
Page or screen title. Example: Checkout
desktop, mobile, tablet, or server.
User’s language. Example: en-US
Your event-specific parameters.
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
});
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.
Screen name. Only used in apps. Example: HomeScreen
// 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.
ISO 4217 code. Required if value is set. Example: USD
Sum of (price × quantity) for all items. Exclude shipping and tax. Example: 89.99
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).
ID of the list. Example: bestsellers
Name of the list. Example: Bestsellers
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.
ID of the list. Example: search_results
Name of the list. Example: Search Results
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
}]
});
Fires when a user views a promotion (banner, offer).
Promotional creative name. Example: blackfriday_hero
Creative slot. Example: homepage_banner
Promotion ID. Example: PROMO_BF2025
Promotion name. Example: Black Friday 2025
hardal . track ( "view_promotion" , {
promotion_id: "PROMO_BF2025" ,
promotion_name: "Black Friday 2025" ,
creative_name: "blackfriday_hero" ,
creative_slot: "homepage_banner"
});
Fires when a user clicks a promotion.
Promotional creative name. Example: blackfriday_hero
Creative slot. Example: homepage_banner
Promotion ID. Example: PROMO_BF2025
Promotion name. Example: Black Friday 2025
hardal . track ( "select_promotion" , {
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.
The search term entered. Example: bluetooth speaker
hardal . track ( "search" , {
search_term: "bluetooth speaker"
});
add_to_cart
Fires when a user adds an item to their cart.
ISO 4217 code. Required if value is set. Example: USD
Sum of (price × quantity). Exclude shipping and tax. Example: 59.99
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.
ISO 4217 code. Example: USD
Value of removed items. Example: 12.99
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.
ISO 4217 code. Required if value is set. Example: USD
Sum of (price × quantity). Example: 299.00
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.
ISO 4217 code. Required if value is set. Example: USD
Sum of (price × quantity). Exclude shipping and tax. Example: 174.98
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.
ISO 4217 code. Required if value is set. Example: EUR
Sum of (price × quantity). Exclude shipping and tax. Example: 549.00
Event-level coupon code. Example: WELCOME10
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.
ISO 4217 code. Required if value is set. Example: GBP
Sum of (price × quantity). Exclude shipping and tax. Example: 189.00
Event-level coupon code. Example: FREESHIP
Shipping tier. Example: Next-day
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.
ISO 4217 code. Required if value is set. Example: USD
Sum of (price × quantity). Exclude shipping and tax. Example: 349.99
Event-level coupon code. Example: GAMER15
Payment method. Example: Credit Card
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.
Unique transaction ID. Prevents duplicates. Example: ORD-20250615-7891
Total order value. Exclude shipping and tax. Example: 214.98
ISO 4217 code. Example: USD
Total tax. Example: 17.20
Total shipping cost. Example: 5.99
Event-level coupon code. Example: SUMMER20
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.
Transaction ID of the original purchase. Example: ORD-20250615-7891
Refund value. Example: 134.99
ISO 4217 code. Example: USD
Tax refunded. Example: 10.80
Shipping refunded. Example: 0
Coupon from original purchase. Example: SUMMER20
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.
Unique lead identifier. Example: LEAD-12345
ISO 4217 code. Required if value is set. Example: USD
Monetary value of the lead. Example: 500
Source of the lead. Example: Trade show
Contact name. Example: John Doe
Lead category. Example: Enterprise
Lead type. Example: demo_request
Custom label. Example: Summer Campaign
City. Example: San Francisco
Region/state/district. Example: California
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.
Signup method. Example: Google
Predicted user value / LTV. Example: 0
ISO 4217 code. Example: USD
hardal . track ( "sign_up" , {
method: "Google"
});
login
Fires when a user logs in.
Login method. Example: Email
hardal . track ( "login" , {
method: "Email"
});
share
Fires when a user shares content.
Share method. Example: WhatsApp
Type of shared content. Example: product
ID of the shared content. Example: RUN-AIR-42
hardal . track ( "share" , {
method: "WhatsApp" ,
content_type: "product" ,
item_id: "RUN-AIR-42"
});
subscribe
Fires when a user subscribes to a list or notifications.
List name. Example: Weekly Deals
List ID. Example: NL_DEALS_01
hardal . track ( "subscribe" , {
list_name: "Weekly Deals" ,
list_id: "NL_DEALS_01"
});
trial_start
Fires when a user starts a free trial.
Plan name or tier. Example: business
Trial duration in days. Example: 30
Plan value. Example: 79.00
ISO 4217 code. Example: USD
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).
Currency name. Example: StarCoins
Amount earned. Example: 150
hardal . track ( "earn_virtual_currency" , {
virtual_currency_name: "StarCoins" ,
value: 150
});
spend_virtual_currency
Fires when a user spends virtual currency.
Currency name. Example: StarCoins
Amount spent. Example: 75
Item purchased. Example: Dragon Shield
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.
User’s phone number. Example: 14155551234
First name. Example: Alex
Last name. Example: Rivera
Your platform’s user ID. Example: USR_8827
Birthday in YYYY-MM-DD. Example: 1990-01-15
City. Example: San Francisco
State or region. Example: CA
Zip or postal code. Example: 94107
Country code. Example: US
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.
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
Item-level coupon. Example: SHOE10OFF
Unit discount value. Example: 9.00
Position in a list. Example: 0
Secondary category. Example: Running
Tertiary category. Example: Trail
List ID. Example: new_arrivals
List name. Example: New Arrivals
Variant. Example: midnight_black
SKU code. Example: TF-AIR42-BLK
Original price before discounts. Example: 98.99
Tax for the item. Example: 7.20
Variant identifier. Example: VAR-AIR42-BLK-10
Product page URL. Example: https://store.example.com/product/airstride-running-shoes