# Analytics Tracking (/docs/portal/webchat/analytics-tracking)





**Analytics Tracking** pushes DealerAI's engagement and lead events into analytics tools you
already own, so chat activity shows up beside the rest of your website's numbers instead of only
in the portal. Open **Webchat**, then **Analytics Tracking**.

<img alt="Analytics Tracking form" src="__img0" />

One switch, **Enabled**, governs the whole page. Everything below it is hidden until it is on.

Google Analytics [#google-analytics]

Two fields, and what you get depends on how many you fill in.

| Field                 | What it is                                                      |
| --------------------- | --------------------------------------------------------------- |
| **GA4 tracking code** | Your Google tag ID — it starts with `G-` or `AW-`               |
| **API Secret**        | A Measurement Protocol secret, created in the same GA4 property |

With the tracking code in place, DealerAI sends:

* **SMS sent** — `dealerai_sms_engaged` and `dealerai_sms_lead`
* **Webchat first message sent** — `dealerai_webchat_engaged`
* **Lead captured** — `dealerai_webchat_lead`. This one needs both the tracking code and the
  API Secret.

Finding your tracking code [#finding-your-tracking-code]

<Steps>
  <Step>
    Sign in to 

    [Google Analytics](https://analytics.google.com/)

    .
  </Step>

  <Step>
    Click 

    **Admin**

    .
  </Step>

  <Step>
    At the top of the 

    *Property*

     column, select your property.
  </Step>

  <Step>
    In the 

    *Property*

     column, click 

    **Data streams**

    , then click the data stream.
  </Step>

  <Step>
    In the 

    *Google tag*

     section at the bottom of 

    *Web stream details*

    , click 

    **Configure tag settings**

    .
  </Step>

  <Step>
    In 

    *Your Google tag*

    , copy the ID that starts with 

    `G-`

     or 

    `AW-`

    .
  </Step>
</Steps>

Creating your API Secret [#creating-your-api-secret]

<Steps>
  <Step>
    In the same property, open 

    **Admin → Data streams**

     and click the data stream.
  </Step>

  <Step>
    In the 

    *Events*

     section of 

    *Web stream details*

    , click 

    **Measurement Protocol**

    .
  </Step>

  <Step>
    Click 

    **Create**

    , then copy the secret value.
  </Step>
</Steps>

Meta Pixel [#meta-pixel]

| Field                   | What it is                                      |
| ----------------------- | ----------------------------------------------- |
| **Meta Pixel ClientId** | Your pixel's ID                                 |
| **Meta Pixel Token**    | The conversions API access token for that pixel |

**Send Pixel lead events for Reach and non-webchat channels** extends pixel lead reporting beyond
the website widget — leads that come from Reach sequences, SMS, and the other channels are
reported too. Leave it off and only webchat leads are counted.

Saving [#saving]

**Save** writes the page; **Cancel** restores what was last saved. Events start arriving once the
credentials are correct — allow time for them to surface in GA4's reports, which are not
instantaneous.
