# Using Google Analytics with Magento

> Track visitors and sales in your Magento store by connecting Google Analytics in the admin panel, with an optional GA4 and Tag Manager setup.

Source: https://helpcenter.ruachost.com/apps/magento/using-google-analytics-with-magento/

Google Analytics provides detailed statistics about visitor traffic, conversions, and customer behavior. Integrating it with **Magento** helps you monitor store performance, optimize marketing campaigns, and improve customer experience.

## Steps to Enable Google Analytics in Magento

### Step 1: Create a Google Analytics Account

1. Go to Google Analytics.
2. Create a new property for your Magento store.
3. Copy the **Tracking ID** (UA‑XXXXXXXXX or GA4 ID starting with `G-`).

### Step 2: Configure in Magento Admin

- **Magento 2**:

  1. Log in to the Magento admin panel.
  2. Navigate to **Stores → Configuration → Sales → Google API → Google Analytics**.
  3. Set **Enable** to **Yes**.
  4. Enter your **Tracking ID**.
  5. Save the configuration.
- **Magento 1.x**:

  1. Log in to the admin panel.
  2. Go to **System → Configuration → Sales → Google API → Google Analytics**.
  3. Enable Google Analytics and enter your Tracking ID.
  4. Save changes.

### Step 3: Verify Integration

- Log in to Google Analytics.
- Go to **Realtime → Overview**.
- Visit your Magento store in another browser tab.
- You should see your visit appear in the realtime dashboard.

## Advanced Setup: GA4 + Google Tag Manager

- GA4 is the new standard replacing Universal Analytics.
- Use **Google Tag Manager (GTM)** or Magento GA4 extensions for enhanced ecommerce tracking.
- Benefits include:

  - Funnel tracking.
  - Predictive metrics.
  - Real‑time ecommerce reports
