> For the complete documentation index, see [llms.txt](https://docs.devhub.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devhub.com/analytics/google-analytics.md).

# Google Analytics

## Viewing automatically tracked events

### In Google Analytics 3 (GA3)

All trackers are detected on-page and [automatically tracked events](/analytics/what-events-are-tracked-automatically.md) are sent.

No manual configuration is needed

Events are visible under "Reports > Behavior > Events"

![](/files/amG9N9BcyYsqiXnhCG6o)

The "Event Category" and "Event Action" for each event type can be viewed here: <https://docs.devhub.com/analytics/what-events-are-tracked-automatically>

For [Custom events](/analytics/custom-events.md), those are sent with an "Event Category" of "custom" and the "Event Action" is based on the name given to the custom event within the `data-sb-custom-event` attribute.

### In Google Analytics 4 (GA4)

GA4 properties are supported, but automatic tracking is dependent on how the GA is being added to the page. There are two scenarios below:

* Deployed via gtag placed within the current page
* Deployed via GTM (Google Tag Manager)

#### Deployed via gtag placed within the current page

`gtag` code is automatically detected and events are sent with no manual configuration needed.

Events are then visible under "Reports > Engagement > Events" mixed in with the normal GA4 events

![link-call and custom-link are events dispatched from our event tracking](/files/4UQ9NlVln5K5fRGlXRNx)

The "Event category" and "Event name" for each event type can be viewed here: <https://docs.devhub.com/analytics/what-events-are-tracked-automatically>

For [Custom events](/analytics/custom-events.md), those are sent with an "Event category" of "custom" and the "Event name" is based on the name given to the custom event within the `data-sb-custom-event` attribute.

#### Deployed via GTM (Google Tag Manager)

GTM container codes are detected on page and events are pushed to these GTM containers automatically.

Event activity is visible under the Google Tag Manager "Tag assistant" preview mode

To see these custom events in the GA4 property requires manual mapping of these events from GTM to GA4 within the GTM configuration.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.devhub.com/analytics/google-analytics.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
