# Google Analytics 4 (GA4) Integration

Spara's integration with Google Analytics allows you to choose which property will receive the conversion events and which of these four events to send:

* **Lead engaged** — Tracks when a lead sends their first message to Spara
* **Email captured** — Tracks when a lead's email address is captured by Spara
* **Calendar shown** — Tracks when a lead views the calendar booking widget
* **Demo scheduled** — Tracks when a lead schedules a call or books a demo

### Step 1: Authentication

{% hint style="info" %}
You must be a Manager- or Integrator-level user to manage third party integrations.
{% endhint %}

Navigate to the [Integrations](https://app.spara.co/organization/integrations) page by clicking on the [Settings](https://app.spara.co/organization) link in the left hand navigation bar.

1. Click the "Authorize" button. This will lead you through a flow to link your Google Analytics account

<figure><img src="/files/6jgeNSpe8QLgwsbYX6hZ" alt=""><figcaption></figcaption></figure>

2. Click "Connect" and log into your Google account.
3. After connecting your account, a warning page will appear, as shown below. You have two options:
   * Wait for up to a few days for Google to verify the app, or
   * Bypass the warning by selecting **Advanced > Go to Spara**, then continue setting up the integration.

<figure><img src="/files/sgdVoGGH3SASnvfEUxSv" alt="" width="375"><figcaption></figcaption></figure>

### Step 2: Configure Google Analytics

Select the property to receive Spara conversion events and choose the event tracking settings.

<figure><img src="/files/i8Zp6cmEBQnooSsbdDEP" alt=""><figcaption></figcaption></figure>

### Step 3: Tracking Spara Events in Google Analytics

#### Step 3a: Get Your Measurement ID

1. Log in to[ analytics.google.com](https://www.google.com/search?q=https://analytics.google.com).
2. Click Admin (Settings gear icon) in the bottom left corner.
3. Navigate to Data collection and modification > Data Streams.
4. Click on your specific website data stream.
5. In the window that opens, copy the Measurement ID (it starts with G-).

#### Step 3b: Configure the Tag in GTM

1. Log in to[ tagmanager.google.com](https://www.google.com/search?q=https://tagmanager.google.com) and open your Workspace.
2. Click Tags on the left menu, then click the New button.
3. Name your tag (e.g., "GA4 - SPARA Event").
4. Click the Tag Configuration box.
5. Select Google Analytics: GA4 Event.
6. Configuration:
   1. Measurement ID: Paste the ID you copied from Google Analytics.
   2. Event Name: Enter a name describing the event (e.g., spara\_conversion). Note: This is the name that will appear in your GA4 reports.

#### Step 3c: Configure the Trigger

1. Scroll down to the Triggering box and click it.
2. In the top right corner of the menu that appears, click the Plus (+) button to create a new trigger.
3. Name the trigger (e.g., "Trigger - SPARA Demo Booked").
4. Click the Trigger Configuration box and scroll down to select Custom Event.
5. Event Name: Enter the exact code provided below that corresponds to the action you want to track. It must match the data layer exactly:
   1. lead\_engaged\_via\_spara
   2. email\_captured\_via\_spara
   3. calendar\_shown\_via\_spara
   4. demo\_scheduled\_via\_spara
6. Note: If you want to track multiple actions, you must create a separate Trigger (and corresponding Tag) for each event name.
7. Click Save to save the Trigger.

#### Step 3d: Finalize and Publish

1. Click Save on the Tag configuration screen.
2. Verify your workspace changes look correct (1 Tag and 1 Trigger added).
3. Click the blue Submit button in the top right corner.
4. Add a version name (e.g., "Added SPARA Tracking") and click Publish.

#### Step 3e: Verify with Preview Mode

Before assuming everything is working, you should test the setup using Google Tag Manager's "Preview" mode.

1. Enter Preview Mode:
   1. In your Google Tag Manager workspace, click the Preview button in the top right corner (next to Submit).
   2. Enter your website URL in the window that pops up and click Connect.
   3. A new window will open with your website, and a "Tag Assistant Connected" badge should appear in the bottom right corner.
2. Trigger the Event:
   1. On your website (in the new window), interact with the SPARA software to force the event to happen.
   2. Example: If you set up the spara\_email\_provided trigger, actually type a test email into the SPARA widget.
3. Check the Debug Window:
   1. Go back to the Tag Assistant tab (the window where you clicked "Connect").
   2. On the left-hand specific Summary column, look for the event name you entered (e.g., spara\_email\_provided). It should appear in the list as you perform the action.
   3. Click on that event name in the list.
4. Confirm the Tag Fired:
   1. After clicking the event name, look at the main window under the Tags Fired section.
   2. You should see your "GA4 - SPARA Event" tag listed there.
   3. *If the tag is listed under "Tags Not Fired," click it to see which trigger condition failed.*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.spara.com/integrations/google-analytics-4-ga4-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
