# Integration with Google Tag Manager (GTM)

{% hint style="info" %}
Cookie3 Analytics has a dedicated configuration for Google Tag Manager and provides a GTM-specific snippet during the site setup process.
{% endhint %}

## **Create a New Tag**

In your Google Tag Manager account, begin by adding a new tag.

* Click on “**Add New Tag**.”

### **Configure the Tag**

Under the tag configuration, choose “**Custom HTML**” as the tag type.

### **Insert the Cookie3 Analytics Snippet**

In the **HTML** field within the “Custom HTML” section, paste your Cookie3 Analytics GTM tracking snippet.

* If you’ve already added your site, you can retrieve this snippet in the “**Manage Websites**” page, which you can access from the application’s sidebar navigation

### **Set a Trigger for the Tag**

After adding the snippet, you need to create a trigger to fire the tag.

* Choose “**All Pages**” and filter by “**Page View**” to ensure the tag counts visits across all your pages.

{% hint style="warning" %}
Be cautious with advanced settings such as tag firing priority, tag sequencing, and consent checks, as these can affect how and when the Cookie3 Analytics script loads.
{% endhint %}

### **Name and Save the Tag**

* Give your tag a descriptive name for easy identification.
* Click on the “**Save**” button.

### **Submit and Publish Your Changes**

* After saving the tag, click on the “**Submit**” button to submit the changes.
* Then, click on the “**Publish**” button to apply the changes to your website.

### **Verify the Integration**

Once published, visit your website to confirm that the Cookie3 Analytics script has been added.

* You can also verify the tracking in your Cookie3 Analytics account to ensure stats are being collected.


---

# 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.cookie3.com/cookie3-analytics/setup-your-site-or-app/installation-guide/integration-with-google-tag-manager-gtm.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.
