# Google Analytics Tracking

The setup of the tracking works the same way as [Google Ads](https://docs.shop-studio.io/pixelyourshop/tracking/google-ads/) via the `Google gtag`, which makes it particularly easy to set up.

{% hint style="info" %}
**Tip**

You can configure the following steps per sales channel & language individually, which ultimately gives you more tracking flexibility.\\
{% endhint %}

### Activate tracking <a href="#activate-tracking" id="activate-tracking"></a>

To activate the `Google gtag` you have to go to `"Your sales channel" > Pixel Your Shop > Google gtag` in the admin and activate the `Opt-In` switch.

### Connect accounts <a href="#connect-accounts" id="connect-accounts"></a>

After activation, you simply need to add your `Google Analytics Tracking ID`. Note that you can also connect multiple accounts at the same time by simply placing multiple IDs in the same input.

By default, the IP addresses of your visitors are already anonymized. You can change the default behavior by disabling the `Make IP anonymous` check box.

### Enable tracking events <a href="#enable-tracking-events" id="enable-tracking-events"></a>

By default, all tracking events are disabled. To activate the individual events you simply have to activate the corresponding switch. If you do not know exactly which events you need, we recommend simply activate all tracking events. Collecting more data can never hurt!

### Legacy: Enable Enhanced ECommerce (UA) <a href="#legacy-enable-enhanced-ecommerce-ua" id="legacy-enable-enhanced-ecommerce-ua"></a>

{% hint style="warning" %}
**Attention**

If you are using Google Analytics 4 (GA4), then you don't need to follow the steps below. and you are done. You can recognize GA4 by the fact that the bottom steps are no longer in the UI. GA4 changes & simplifies the way e-commerce events are tracked.
{% endhint %}

To do this, go to `ECommerce Settings` in your Google Analytics account to activate the advanced e-commerce tracking.

![](/files/-MhUjhlbBYkV4GatOZeE)

Now activate the two buttons `Enable ECommerce` & `Enable Enhanced ECommerce Reporting`. At `Checkout-Labeling` you can now add the two funnel steps `Checkout` & `Purchase`. How you name the two steps exactly is up to you. But there must always be **exactly two steps** so that the tracking is working perfectly.

![](/files/-MhUjllygCf9rV85uVY3)

{% hint style="info" %}
**Tip**

Note that you can use the two tracking events `Begin checkout` & `Purchase` in the Shopware Admin under `Marketing > Pixel Your Shop > Google gtag` must be activated for the advanced e-commerce tracking to work.
{% endhint %}

\\


---

# 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.shop-studio.io/shopware/extensions/pixelyourshop/tracking/google-analytics.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.
