---
title: "Adding event triggers for Google Analytics"
date: "2017-11-13T08:18:28+00:00"
summary: "Learn how to add event triggers for Google Analytics in Drupal. This guide covers accessing the analytics form, setting up event attributes, and configuring triggers for click, hover, and view events."
image:
type: "page"
url: "/drupal-starter-kits/add-ons/site-studio/adding-event-triggers-google-analytics"
id: "9c6e820b-b329-4720-be4a-1ac91fbaca9a"
---

You can add attributes to an Element and trigger events within Google Analytics.

Important

Google Analytics must be set-up correctly on your website for Event attributes to work. You need the [Google Tag module](https://www.drupal.org/project/google_tag) installed on your website and setup with your Google tag ID.

Accessing the analytics form
----------------------------

1.  Navigate to a page or template with the Layout canvas
2.  Double click on an **Element** to edit its settings
3.  Click on the **... ellipsis tab** (shown in blue) and click on **Analytics** in the menu (shown in pink).

![041f2b49-accessing-form.png](https://acquia.widen.net/content/e877081a-773a-4e17-81df-6b7912d663e1/web/041f2b49-accessing-form.png)

Add event attributes for Google Analytics
-----------------------------------------

To add Event attributes and trigger them within Google Analytics:

1.  Within the Event attributes area select the action that will trigger the event in Google Analytics in the **Trigger drop-down**
    
    1.  On click triggers the event if the user clicks on the Element. The Element does not have to be a link for this to work.
    2.  On hover triggers the event if the user hovers over the Element. The Element does not have to be a link for this to work.
    3.  On view triggers the event when the Element enters the browser viewport.
    
    ![2e96edb7-adding-event-attributes.png](https://acquia.widen.net/content/57ed3603-3a67-4368-b3cc-4a994e35fe34/web/2e96edb7-adding-event-attributes.png)
    
2.  Enter the attributes you want to send to Google Analytics in the **Category**, **Action**, **Label** and **Value fields**  
    Note that the Category and Action fields are required.
3.  Repeat steps 1 and 2 for multiple event triggers. To set multiple triggers click Add event attributes.
4.  Click **Apply.**

![275975d9-adding-event-attributes-open.png](https://acquia.widen.net/content/07d178f2-d0dc-41c4-a221-02b61e77e19a/web/275975d9-adding-event-attributes-open.png)

Important

For more information on Google Analytics triggers and events, see the [Google documentation](https://support.google.com/analytics/answer/1033068?hl=en).