Installation

Add the following script to your HTML file, preferably in the <head> section:

Configuration Options

The web integration supports the following configuration options:

OptionTypeDefaultDescription
autoPageviewbooleantrueAutomatically track page views
fetchFromGA4booleantrueCollect events from Google Analytics 4
fetchFromDataLayerbooleantrueCollect events from dataLayer

Troubleshooting

Validation

To validate your web integration:

  1. Open your browser’s developer tools
  2. Go to the Network tab
  3. Refresh your page
  4. Look for requests to your Hardal endpoint
  5. Verify that events are being sent successfully

Enable debug mode by setting window.hardalConfig.debug = true to see detailed logging in the browser console.