---
title: "Adding data layer event attributes"
date: "2019-06-03T14:15:07+00:00"
summary: "Learn how to add data layer event attributes to Elements in Cohesion. Enhance your site's analytics capabilities with step-by-step instructions for setting up click, hover, and view triggers."
image:
type: "page"
url: "/drupal-starter-kits/add-ons/site-studio/adding-data-layer-event-attributes"
id: "0f11dd8f-70e0-4db3-b405-c5ee0efcf15b"
---

You can add data layer attributes to an Element.

Important

Google Tag Manager must be set-up correctly on the site for data layer events to work.

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 data layer event attributes
-------------------------------

To add data layer Event attributes and trigger them:

1.  Within the Event attributes area select the action that will trigger the event 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.
2.  Enter the attributes you want to send to the Tag manager in the **Key** and **Value fields**  
    Note that both fields are required.
3.  Repeat steps 1 and 2 for multiple event triggers. To set multiple triggers click Add event attributes.
4.  Click **Apply.**

![b8958d2f-datalayer-event-attributes.png](https://acquia.widen.net/content/1c23923f-cf61-4ce7-95a1-db25ced6a774/web/b8958d2f-datalayer-event-attributes.png)

![d6930555-datalayer-event-attributes-open.png](https://acquia.widen.net/content/19938b88-e216-43e6-8e16-6eb96ebe559d/web/d6930555-datalayer-event-attributes-open.png)