> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://knowledge.clym.io/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Google Tag Manager events

If you use Google Tag Manager (GTM) to manage scripts on your website, Clym can trigger custom GTM events based on user consent. You can then configure your tags to fire only when those events occur. This allows you to keep all of your scripts within Google Tag Manager while still managing them based on consent, without requiring any changes to your website.

Custom Google Tag Manager events let your tags fire when specific consent-related events occur. For example, if you have a Google Analytics tag set up in GTM and a user accepts Google Analytics through the Clym widget, Clym sends an event to Google Tag Manager indicating that Google Analytics has been accepted. You can configure your Google Analytics tag to listen for that event, ensuring it only fires after the user has given consent.

Events Clym sends:
* Consent accepted
* Consent rejected

To begin, sign in to your **Google Tag Manager** container.

###### ![Variables](https://storage.crisp.chat/users/helpdesk/website/-/a/e/3/8/ae38f50f15c00000/image_1bwfszd.png =600x581)
Navigate to **Variables**. Click on **New** in **User-Defined Variables**.

###### ![DataLayer variable](https://storage.crisp.chat/users/helpdesk/website/-/a/e/3/8/ae38f50f15c00000/image_1eatnwe.png =600x442)
Choose a variable type, select **Data Layer Variable**. Name the **Data Layer Variable Name** to be: **clymServiceId** and name the **Variable** on top to: **Clym Service Id**.
###### ![clymServiceId Variable](https://storage.crisp.chat/users/helpdesk/website/-/a/e/3/8/ae38f50f15c00000/image_1lkb8xq.png =600x387)
Create a new variable with **clymServiceName** and **Clym Service Name**.

###### ![clymServiceName Variable](https://storage.crisp.chat/users/helpdesk/website/-/a/e/3/8/ae38f50f15c00000/image_czklg9.png =600x352)
Navigate to **Triggers**, create a **New** one for each service you wish to control.
###### 
### ![Clym Consent Accepted - Google Analytics](https://storage.crisp.chat/users/helpdesk/website/-/a/e/3/8/ae38f50f15c00000/image_1bqdg76.png =600x223)

If you encounter any challenges, please reach out to support@clym.io.