> For the complete documentation index, see [llms.txt](https://docs.storysdk.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.storysdk.com/tutorial/integrations/google-analytics.md).

# Google Analytics

For this, you will need a Measurement ID. To find the Measurement ID in your Google Analytics account, follow these steps:

1. **Log in to Google Analytics**: Go to [Google Analytics](https://analytics.google.com) and sign in with your account.
2. **Select the Account and Property**: From the dashboard, choose the account and property for which you want to retrieve the Measurement ID.
3. **Go to Admin Settings**: Click on the **Admin** option in the lower-left corner of the interface.
4. **Access Data Streams**: Under the **Property** column, select **Data Streams**.

<figure><img src="/files/82NabkpcgO26YbhMNhxF" alt=""><figcaption></figcaption></figure>

5. **Choose Your Data Stream**: Click on the data stream associated with your website or app.

<figure><img src="/files/7XWA92uZrFHCNeFopnCE" alt=""><figcaption></figcaption></figure>

6. **Find the Measurement ID**: In the data stream details, you will see the Measurement ID at the top of the page. It starts with "G-" followed by a unique series of numbers and letters.

<figure><img src="/files/t56MT4sNn7Sm40O1X65Q" alt=""><figcaption></figcaption></figure>

Make sure to copy this ID for use in your integrations.

7. **Go to the Integrations tab** in the StorySDK dashboard.

<figure><img src="/files/jLOIHSwlJOfhPd91Zz7Q" alt=""><figcaption></figcaption></figure>

8. **Find the Google Analytics card** and **click the "Activate" button**. In the modal window that opens, paste the obtained Measurement ID and click the "Save" button.

<figure><img src="/files/tvjThM0sKgR6nq1SXbaW" alt=""><figcaption></figcaption></figure>

9. After that, the indicator on the card will turn green, and the label will change to "Active".

<figure><img src="/files/FkOF5XQe8ZfjrdWD14Qs" alt=""><figcaption></figcaption></figure>

You can change the Measurement ID at any time by clicking the "Configure" button on the card. To delete the integration, simply leave the field empty and click "Save."

## StorySDK Google Analytics Events

* **`storysdk_group_duration`**: This event tracks the duration of time a user spends on a specific group of stories or content within the StorySDK.
* **`storysdk_group_open`**: This event is triggered when a user opens a group of stories within the StorySDK.
* **`storysdk_group_close`**: This event is triggered when a user closes or exits a group of stories  within the StorySDK.
* **`storysdk_story_duration`**: This event tracks the duration of time in seconds a user spends on a single story within the StorySDK.
* **`storysdk_story_impression`**: This event is triggered when a story or content is shown more then one second.
* **`storysdk_story_open`**: This event is triggered when a user opens or starts viewing a particular story within the StorySDK.
* **`storysdk_story_close`**: This event is triggered when a user closes or finishes viewing a particular story within the StorySDK.
* **`storysdk_story_next`**: This event is triggered when a user navigates to the next story  in a sequence within the StorySDK.
* **`storysdk_story_back`**: This event is triggered when a user navigates to the previous story  in a sequence within the StorySDK.
* **`storysdk_widget_answer`**: This event is triggered when a user provides an answer or interacts with a widget within a story  in the StorySDK.
* **`storysdk_widget_click`**: This event is triggered when a user clicks on a widget or interactive element within a story in the StorySDK.
* **`storysdk_quiz_start`**: This event is triggered when a user starts a quiz or interactive questionnaire within the StorySDK.
* **`storysdk_quiz_finish`**: This event is triggered when a user finishes a quiz or interactive questionnaire within the StorySDK.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.storysdk.com/tutorial/integrations/google-analytics.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
