# Google Analytics

You can send demo analytics as custom events to your GA Account with Google Analytics integration.&#x20;

### How to Integrate

* Go to the [integrations page](https://app.storylane.io/integrations) in the Storylane Dashboard.
* Navigate to the Google Analytics integration, and click 'Connect'&#x20;
* Enter your Google Analytics measurement ID in the field (see the screenshot below)

<div align="left"><figure><img src="https://2431356420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FN8hWd9k2Pbb6YSWO4pUQ%2Fuploads%2FrNf49Kwe8lBmm6JQqJQE%2FScreenshot%202025-11-21%20at%2015.52.21.png?alt=media&#x26;token=bd5ce192-bde2-4213-b0ab-db41b2205838" alt="" width="563"><figcaption></figcaption></figure></div>

* Once finished, the status will change to 'Connected'

<div align="left"><figure><img src="https://2431356420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FN8hWd9k2Pbb6YSWO4pUQ%2Fuploads%2Fv4c9RDxFEdtNySnLZbqf%2FScreenshot%202024-08-14%20at%2020.20.17.png?alt=media&#x26;token=36aac965-2100-4f13-85b8-0bd038c026ba" alt="" width="375"><figcaption></figcaption></figure></div>

* If you want to make any change to the GA measurement ID, or uninstall the integration, just click on the settings icon.

<div align="left"><figure><img src="https://2431356420-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FN8hWd9k2Pbb6YSWO4pUQ%2Fuploads%2F8iuXxqGhurwQob9BbyJA%2FScreenshot%202025-11-21%20at%2015.52.50.png?alt=media&#x26;token=02c75f2c-faaa-4849-872a-ed34beb8d5a5" alt="" width="563"><figcaption></figcaption></figure></div>

Demo:

{% @storylane/embed subdomain="app" linkValue="vkdcknxtsxcp" url="<https://app.storylane.io/share/vkdcknxtsxcp>" %}

### **Verify the Integration**

You can install [Google Tag Assistant](https://chrome.google.com/webstore/detail/tag-assistant-companion/jmekfmbnaedfebfnmakmokmlfpblbfdm) to test and verify the events coming from your page.

### Custom Events

Below are the custom events sent to GA from Storylane

**Demo opened -** sent when the demo is opened&#x20;

<pre class="language-json"><code class="lang-json"><strong>{ 
</strong>  "name": "sl_demo_open",
  "params": {
    "demo_id": "xxxxx-363b-4d39-9ecc-87c4b6212a42",
    "demo_url": "http://app.storylane.io/share/xxxxxxx",
    "demo_name": "xxxxxxx"
  },
  "timestamp_micros": "1664291507089000"
}
</code></pre>

**Demo finished -** sent when the demo is finished

```json
{ 
  "name": "sl_demo_finished",
  "params": {
    "demo_id": "xxxxx-363b-4d39-9ecc-87c4b6212a42",
    "demo_name": "xxxxxxx",
    "demo_url": "http://app.storylane.io/share/xxxxxxx"
  },
  "timestamp_micros": "1664291507089000"
}
```

**Step viewed** - sent when the step in the guide is viewed

```json
{
  "name": "sl_step_view",
  "params": {
    "demo_id": "xxxxx-363b-4d39-9ecc-87c4b6212a42",
    "demo_url": "http://app.storylane.io/share/xxxxxxx",
    "demo_name": "xxxxxxx",
    "flow_id": "xxxxx-e7ef-4687-a88e-91630da34d89",
    "flow_name": "Flow 1",
    "chapter_id": "xxxxx-e7ef-4687-a88e-91630da34d89",
    "chapter_name": "Chapter 1",
    "step_id": "xxxxx-61c3-44cb-8ad9-0c2c24cf18c0"
  },
  "timestamp_micros": "1664291511150000"
}
```

**Flow started** - sent when the flow is started <mark style="color:orange;">**(deprecated -**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">see</mark> <mark style="color:orange;"></mark><mark style="color:orange;">**chapter\_start**</mark><mark style="color:orange;">)</mark>&#x20;

```json
{
  "name": "sl_flow_start",
  "params": {
    "demo_id": "xxxxx-363b-4d39-9ecc-87c4b6212a42",
    "demo_name": "xxxxxxx",
    "demo_url": "http://app.storylane.io/share/xxxxxxx",
    "flow_id": "xxxxx-e7ef-4687-a88e-91630da34d89",
    "flow_name": "Flow 1"
  },
  "timestamp_micros": "1664291510912999"
}
```

**Chapter started** - sent when the chapter is started

```json
{
  "name": "sl_chapter_start",
  "params": {
    "demo_id": "xxxxx-363b-4d39-9ecc-87c4b6212a42",
    "demo_url": "http://app.storylane.io/share/xxxxxxx",
    "demo_name": "xxxxxxx",
    "chapter_id": "xxxxx-e7ef-4687-a88e-91630da34d89",
    "chapter_name": "Chapter 1"
  },
  "timestamp_micros": "1664291510912999"
}
```

**Flow ended** - sent when the flow ends <mark style="color:orange;">**(deprecated -**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">see</mark> <mark style="color:orange;"></mark><mark style="color:orange;">**chapter\_end**</mark><mark style="color:orange;">)</mark>&#x20;

<pre class="language-json"><code class="lang-json"><strong>{
</strong>  "name": "sl_flow_end",
  "params": {
    "demo_id": "xxxxx-363b-4d39-9ecc-87c4b6212a42",
    "demo_name": "xxxxxxx",
    "demo_url": "http://app.storylane.io/share/xxxxxxx",
    "flow_id": "xxxxx-e7ef-4687-a88e-91630da34d89",
    "flow_name": "Flow 1"
  },
  "timestamp_micros": "1664291553205000"
}
</code></pre>

**Chapter ended** - sent when the chapter ends

<pre class="language-json"><code class="lang-json"><strong>{
</strong>  "name": "sl_chapter_end",
  "params": {
    "demo_id": "xxxxx-363b-4d39-9ecc-87c4b6212a42",
    "demo_url": "http://app.storylane.io/share/xxxxxxx",
    "demo_name": "xxxxxxx",
    "chapter_id": "xxxxx-e7ef-4687-a88e-91630da34d89",
    "chapter_name": "Chapter 1"
  },
  "timestamp_micros": "1664291553205000"
}
</code></pre>

**Page viewed** - sent when the page is viewed/changed

{% hint style="warning" %}
Tracked only on HTML demos
{% endhint %}

```json
{
  "name": "sl_page_view",
  "payload": {
    "demo_id": "fhjksf",
    "demo_url": "https://app.storylane.io/share/fhjksf",
    "demo_name": "Cool demo",
    "page_id": "slkfjlsjf-ksjf-fsdfsf4r34",
    "page_name": "Pricing page html"
  }
}
```

**Lead captured** - sent when a lead is captured or identified

```json
{
  "name": "sl_lead_identify",
  "params": {
    "demo_id": "xxxxx-363b-4d39-9ecc-87c4b6212a42",
    "demo_name": "xxxxxxx",
    "demo_url": "http://app.storylane.io/share/xxxxxxx",
    "email": "peter@acme.io",
    "name": "Peter",
    "source": "internal_form",
    "lead_first_name": "Peter",
    "lead_last_name": "Josh"
  },
  "timestamp_micros": "1664291550241000"
}
```

**Primary CTA opened** - sent when user clicks the primary CTA

```json
{
  "name": "sl_primary_cta",
  "params": {
    "demo_id": "xxxxx-363b-4d39-9ecc-87c4b6212a42",
    "demo_url": "http://app.storylane.io/share/xxxxxxx",
    "demo_name": "xxxxxxx",
    "flow_id": "xxxxx-e7ef-4687-a88e-91630da34d89",
    "flow_name": "Flow 1",
    "chapter_id": "xxxxx-e7ef-4687-a88e-91630da34d89",
    "chapter_name": "Chapter 1",
    "step_id": "a67a0b5f-b2ac-49f1-80ea-3a2b22062562"
  },
  "timestamp_micros": "1664291554523000"
}
```

**Secondary CTA opened** - sent when user clicks the secondary CTA

```json
{
  "name": "sl_secondary_cta",
  "params": {
    "demo_id": "xxxxx-363b-4d39-9ecc-87c4b6212a42",
    "demo_name": "xxxxxxx",
    "demo_url": "http://app.storylane.io/share/xxxxxxx",
    "flow_id": "xxxxx-e7ef-4687-a88e-91630da34d89",
    "flow_name": "Flow 1",
    "chapter_id": "xxxxx-e7ef-4687-a88e-91630da34d89",
    "chapter_name": "Chapter 1",
    "step_id": "215458c6-732b-410d-9205-d1440e604478"
  },
  "timestamp_micros": "1664291554523000"
}
```

**Convert CTA opened** - sent when user clicks the convert CTA

```json
{
  "name": "sl_convert_cta",
  "params": {
    "demo_id": "xxxxx-363b-4d39-9ecc-87c4b6212a42",
    "demo_name": "xxxxxxx",
    "demo_url": "http://app.storylane.io/share/xxxxxxx",
    "step_id": "215458c6-732b-410d-9205-d1440e604478",
    "flow_id": "xxxxx-e7ef-4687-a88e-91630da34d89",
    "flow_name": "Flow 1",
    "chapter_id": "xxxxx-e7ef-4687-a88e-91630da34d89",
    "chapter_name": "Chapter 1",
    "ext_url": "https://www.storylane.io/request-demo"
  },
  "timestamp_micros": "1664291554523000"
}
```

**External link opened** - sent when a user clicks a CTA button and is directed to an external URL

```json
{
  "name": "sl_open_external_url",
  "params": {
    "demo_id": "xxxxx-363b-4d39-9ecc-87c4b6212a42",
    "demo_name": "xxxxxxx",
    "demo_url": "http://app.storylane.io/share/xxxxxxx",
    "step_id": "53813cdb-cae4-4f1e-b5e9-8bb484f1ceb0",
    "step_index": "xx",
    "flow_id": "xxxxx-e7ef-4687-a88e-91630da34d89",
    "flow_name": "Flow 1",
    "chapter_id": "xxxxx-e7ef-4687-a88e-91630da34d89",
    "chapter_name": "Chapter 1",
    "ext_url": "xxxxxxxxxxxxxxxx"
  },
  "timestamp_micros": "1664291560202000"
}
```

**Checklist item viewed** - sent when the user opens a checklist item

```json
{
  "name": "sl_checklist_item_view",
  "params": {
    "demo_id": "xxxxx-363b-4d39-9ecc-87c4b6212a42",
    "demo_url": "http://app.storylane.io/share/xxxxxxx",
    "demo_name": "xxxxxxx",
    "checklist_item_id": "b87f66e1-7467-4394-854f-a082e25a469a"
  },
  "timestamp_micros": "1664291560202000"
}
```


---

# 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.storylane.io/integrations/integrations/google-analytics.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.
