Website Setup
Install and configure Hardal for your web applications
Overview
The Hardal Web Script enables you to track user behavior and collect analytics data from your web applications. This guide will walk you through the basic installation and configuration process.
Prerequisites
Before you begin the installation, ensure you have:
-
Access to your website’s HTML source code
-
Admin access to your Hardal dashboard
-
Basic knowledge of HTML and JavaScript
You should create a custom domain for first-party data ownership. It is best practice to create one before the installation.
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 following:
Replace <your-hardal-signal-id>
with your actual Signal ID.
If you create a custom domain and check it within the same setup page, your Hardal Script will be updated with regarding endpoint.
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 events are being sent successfully
-
Check your Hardal Dashboard to see real-time events are reflected accordingly
Configuration Options
The script supports the following configuration options in the window.hardalConfig.options
object:
Option | Type | Default | Description |
---|---|---|---|
autoPageview | boolean | true | Automatically tracks page views when enabled |
fetchFromGA4 | boolean | true | Collects events from Google Analytics 4 |
fetchFromDataLayer | boolean | true | Collects events from dataLayer |
debug | boolean | false | Enables detailed logging in console |
Troubleshooting
Common Installation Issues
Was this page helpful?