# Google Analytics

Integrating **Google Analytics (GA4)** allows you to track how visitors interact with your site. It helps you understand where your users come from, which steps of your quiz they complete, and where they drop off before making a purchase. By using this data, you can improve your sales funnel and increase your conversion rates.

## Integration Steps

1. **Open Integrations:** In your Zotlo panel, click the **"Integrations"** tab in the side menu.
2. **Select Google Analytics:** Find Google Analytics in the list.
3. **Enter your ID:** Paste your code into the **GA4  ID** field and save.

## **GA4 Measurement ID**

* It is a unique identifier (format: `G-XXXXXXXXXX`) that tells Google where to send your website's data.
* **Where to find it**

  &#x20;1\. Log in to your [Google Analytics](https://analytics.google.com/) account. \
  2\. Go to **Admin** > **Data Streams**. \
  3\. Select your website stream. \
  4\. Copy the **Measurement ID** from the top right corner.

## Events Tracked

Once activated, Zotlo automatically sends these actions to your Google Analytics account:

| Activity        | What is tracked?                                                                     |
| --------------- | ------------------------------------------------------------------------------------ |
| **Visits**      | Every time a user loads a page in your funnel.                                       |
| **Quiz/Survey** | Button clicks, selected answers, and navigation through the quiz steps.              |
| **User Info**   | Successful email entries or errors when a user types an invalid email.               |
| **Payment**     | Interactions on the payment page, including credit card input errors and API issues. |
| **Sales**       | Successful payments and subscription starts.                                         |
| **General**     | Footer links, homepage buttons, and clicks on the "Success" page.                    |

## Custom Events

Zotlo automatically pushes granular events to the `window.dataLayer` and your GA4 property based on user interactions:

| Page / Step                               | Action        | Description                                                                          |
| ----------------------------------------- | ------------- | ------------------------------------------------------------------------------------ |
| **Homepage( first page of quiz funnels)** | `customClick` | Clicks on homepage buttons (e.g., "Start") including specific button IDs.            |
| **Survey (Quiz)**                         | `customClick` | Navigation clicks to the next question page.                                         |
| **Survey (Quiz)**                         | `answer`      | User responses to questions (single or multiple choice).                             |
| **Registration**                          | `Success`     | Successful email submission.                                                         |
| **Registration**                          | `error`       | Failed email entry attempts and validation errors.                                   |
| **Payment**                               | `customClick` | Clicks on the payment page elements.                                                 |
| **Payment**                               | `error`       | Technical issues including API errors, payment failures, and server response errors. |
| **Success Page**                          | `customClick` | Clicks on "Thank You" page buttons (e.g., "Go to App").                              |
| **Success Page**                          | `customClick` | Clicks on footer links or shared homepage/success page links.                        |

## Purchase Tracking

For successful transactions, Zotlo sends specialized purchase events to ensure accurate revenue tracking:

* **Purchase (`purchase`):** Triggered after a successful payment. Includes full transaction data: `transaction_id`, `value`, `currency`, and `items` (Package ID, name, package period).
* **Subscription Started (`subscription_started`):** A custom event triggered specifically when a new subscription-based product is successfully purchased.
