Skip to content
  • There are no suggestions because the search field is empty.

Google Analytics Integration Set Up

This guide will walk you through the simple steps to set up Google Analytics to receive events from Halda using Google Tag Manager (GTM) and a data layer.

Step 1: Add the Data Layer to Your Header

To ensure Google Tag Manager can process events from Halda, you need to add the following script to your website's <head> section above your Google Tag Manager script:

<script>

window.dataLayer = window.dataLayer || [];

</script>

Your <head> section should look like this after adding the script:

<script>

window.dataLayer = window.dataLayer || [];

</script>




<!-- Google Tag Manager -->

<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':

new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],

j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=

'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);

})(window,document,'script','dataLayer','GTM-XXXXXX');</script>

<!-- End Google Tag Manager -->

Important: Replace GTM-XXXXXX with your actual Google Tag Manager ID.

Example Event Structure

Halda pushes events to the dataLayer in the following format:

JavaScript

dataLayer.push({
   'event': 'HaldaFormSubmit' // })

The example above is just one of the events that can be passed - see below for the full list of possible events.

Step 2: Configure Events in Halda

  1. Navigate to the Integrations page in Halda by clicking the integration icon in the top-right corner.
  2. Select your Google Analytics integration (either add a new one or edit an existing integration).
  3. Change the tracking method from gtag to Data Layer.
  4. Enter your Google Analytics Destination ID.
  5. Select the specific events you want Halda to track.

Step 3: Create Triggers in Google Tag Manager

You’ll need to create a Custom Event Trigger for each type of Halda event you want to track. Below are the events Halda can send:
Untitled design (53)

How to Create a Trigger

  1. Log in to Google Tag Manager.
  2. Select your container.
  3. Navigate to Triggers > New.
  4. Choose Trigger Type: Custom Event.
  5. Set the Event Name to match one of the events listed above (e.g., HaldaFormView).
  6. Under Trigger fires on, select All Custom Events.
  7. Click Save.

💡 Pro Tip: You can create a separate trigger for each event or combine multiple events into one trigger using regular expressions (if you want to fire the same tag for several events).

Step 4: Create Tags in Google Tag Manager

For each Halda event you want to track, you’ll need to create a GA4 Event Tag. Here’s how:

  1. Navigate to Tags > New.
  2. Select Tag Configuration > Google Analytics: GA4 Event.
  3. Enter your Google Analytics Measurement ID.
  4. Under Event Name, enter the exact event name you’re tracking, such as:
    • HaldaFormView
    • HaldaFormSubmit
    • HaldaSearchView
    • HaldaSearchSubmit
    • HaldaHubView
    • HaldaCTA
    • HaldaFormSubmit (Hub form submissions)
    • HaldaSearchSubmit (Hub search submissions)
    • HaldaQuickLink
    • etc..
  5. Click Triggering and select the corresponding Custom Event Trigger you created in Step 2.
  6. Click Save.

Step 5: Publish Your Changes

  1. Click Submit in Google Tag Manager.
  2. Add a name and description for your changes.
  3. Click Publish.

If you have any questions, feel free to reach out to our support team at support@halda.ai — we’re happy to help you get set up!