Web Setup
Install and configure Hardal for your web sites
Overview
The Hardal Web Script enables you to track user behavior and collect cookieless analytics and first-party data from your web sites.
Installation
Get your Hardal Script
- Log into your Hardal account
- Navigate to settings
- Copy your Hardal Script from “Setup” tab
Add the Script
Add your Hardal Script to your HTML file, preferably in the <head>
section. The script should look like the following:
Replace <your-hardal-signal-id>
with your actual Signal ID.
Verify Installation
To verify your installation:
- Open your browser’s developer tools (F12 or right-click → Inspect)
- Go to the Network tab
- Refresh your page
- Look for requests to your Hardal endpoint
- Verify that page view events are being sent successfully
- Check your Hardal Dashboard to see real-time events are reflected accordingly
Custom Event Tracking
Using hardal.track()
You can use the hardal.track()
method to send custom events:
Common Event Examples (hardal.track Method)
Troubleshooting
Common Installation Issues
Script not loading
Script not loading
Problem: The Hardal script isn’t loading on your website.
Potential causes:
- Incorrect script placement
- Invalid Signal ID
- Network connectivity issues
Solutions:
- Script Placement:
- Ensure the script is in the <head> section
- Check if the script tag is properly closed
- Verify there are no conflicting script tags
- Signal ID:
- Double-check your Signal ID in the dashboard
- Ensure there are no spaces or special characters
- Verify you’re using the correct environment (production/development)
- Network Issues:
- Check your browser’s console for network errors
- Verify your domain has internet connectivity
- Ensure DNS resolution is working properly
No events showing
No events showing
Problem: The script is loaded but no events are appearing in your dashboard.
Potential causes:
- Configuration issues
- Events being filtered
- Integration conflicts
Solutions:
- Configuration:
- Verify data-auto-track is set to “true”
- Ensure data-website-id and data-host-url are correctly set
- Check if your custom events are properly implemented
- Event Filtering:
- Check if events are being filtered in your dashboard
- Verify that the events you’re tracking match expected formats
- Integration:
- Check for conflicts with other analytics tools
- Verify script loading order
- Review browser console for errors
Custom events not tracking
Custom events not tracking
Problem: Page views are tracking but custom events are not being recorded.
Potential causes:
- Hardal script loading after event calls
- Incorrect event format or variable references
- JavaScript errors
Solutions:
- Script Timing:
- Ensure the Hardal script is fully loaded before calling custom events
- Place your event tracking code after the Hardal script
- Event Format:
- For Data Layer: Verify the “event” property is correctly specified
- For hardal.track(): Check that the event name and properties match the required format
- Ensure all variable references match exactly what’s in your data layer
- Make sure the events are properly wrapped in script tags
- Debugging:
- Open browser console to check for JavaScript errors
- Verify that the Hardal script is available in the global scope
- Test with hardcoded values instead of variables to confirm the event tracking works