> For the complete documentation index, see [llms.txt](https://docs.chathq.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chathq.io/api-and-developer-docs/custom-tracking-and-analytics/widget-events-in-google-analytics.md).

# Widget Events in Google Analytics

## How To Setup Widget Analytics Using GA4 & GTM

In order to setup widget analytics using Google Analytics and Google Tag Manager you will need to follow the instructions in the following help articles:

{% content-ref url="/pages/8N5Jbinkk05ON8InC1ix" %}
[1. Google Analytics & Google Tag Manager](/api-and-developer-docs/custom-tracking-and-analytics/widget-events-in-google-analytics/1.-google-analytics-and-google-tag-manager.md)
{% endcontent-ref %}

{% content-ref url="/pages/iTOAACOfKkmXO54AmyuF" %}
[2. GA4 Custom Events & Definitions](/api-and-developer-docs/custom-tracking-and-analytics/widget-events-in-google-analytics/2.-ga4-custom-events-and-definitions.md)
{% endcontent-ref %}

{% content-ref url="/pages/mTWdzQkQYjuczF8mUrYa" %}
[3. Tags & Triggers in Google Tag Manager](/api-and-developer-docs/custom-tracking-and-analytics/widget-events-in-google-analytics/3.-tags-and-triggers-in-google-tag-manager.md)
{% endcontent-ref %}

{% content-ref url="/pages/XNcayDa3bFJ2ovmsHwpG" %}
[4. Using the Data Layer to Define Custom Variables](/api-and-developer-docs/custom-tracking-and-analytics/widget-events-in-google-analytics/4.-using-the-data-layer-to-define-custom-variables.md)
{% endcontent-ref %}

{% content-ref url="/pages/3hrz03fpvHzimLZEJIYF" %}
[6. Testing Widget Analytics](/api-and-developer-docs/custom-tracking-and-analytics/widget-events-in-google-analytics/6.-testing-widget-analytics.md)
{% endcontent-ref %}
