> ## Documentation Index
> Fetch the complete documentation index at: https://enrolla-nk-hub-guardrails.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Posthog

> Connect Traceloop to Posthog to combine LLM insights with your product analytics

Connecting Traceloop to Posthog can be done by following these steps:

<Steps>
  <Step title="Get the needed data from Posthog">
    Go to your Posthog instance settings and get the following data:

    * API URL (should be something like `https://us.i.posthog.com`)
    * Project API key (should be in the format `phc_-<key>`)
  </Step>

  <Step title="Set up the Integration within Traceloop">
    Go to the [integrations page](https://app.traceloop.com/settings/integrations) within Traceloop and click on the Posthog card.

    <Frame>
      <img className="block dark:hidden" src="https://mintcdn.com/enrolla-nk-hub-guardrails/3xlRgAdh6RfhliI1/img/traceloop-integrations/integrations-light.png?fit=max&auto=format&n=3xlRgAdh6RfhliI1&q=85&s=61f6befedd296e54909c4922187f463b" width="2570" height="1536" data-path="img/traceloop-integrations/integrations-light.png" />

      <img className="hidden dark:block" src="https://mintcdn.com/enrolla-nk-hub-guardrails/3xlRgAdh6RfhliI1/img/traceloop-integrations/integrations-dark.png?fit=max&auto=format&n=3xlRgAdh6RfhliI1&q=85&s=b54bff690d2ab7b825bbf984b298bbcd" width="2570" height="1536" data-path="img/traceloop-integrations/integrations-dark.png" />
    </Frame>
  </Step>

  <Step title="Fill in the form">
    Fill in the data you got from Posthog. Choose the environment you want to connect to Posthog and click on "Enable".

    <Frame>
      <img className="block dark:hidden" src="https://mintcdn.com/enrolla-nk-hub-guardrails/3xlRgAdh6RfhliI1/img/traceloop-integrations/posthog-light.png?fit=max&auto=format&n=3xlRgAdh6RfhliI1&q=85&s=0154334cceb2ea78d6909a5cf6b6534a" width="3024" height="1807" data-path="img/traceloop-integrations/posthog-light.png" />

      <img className="hidden dark:block" src="https://mintcdn.com/enrolla-nk-hub-guardrails/3xlRgAdh6RfhliI1/img/traceloop-integrations/posthog-dark.png?fit=max&auto=format&n=3xlRgAdh6RfhliI1&q=85&s=73b0689d7cc9cb217b42cfb809d0060d" width="3005" height="1801" data-path="img/traceloop-integrations/posthog-dark.png" />
    </Frame>
  </Step>
</Steps>

**That's it!**

Go to your Posthog instance, click "Activity" and search for events named `traceloop span`.

You can then create a new dashboard from the "LLM Metrics - Traceloop" template to visualize the data.

<Frame>
  <img src="https://mintcdn.com/enrolla-nk-hub-guardrails/3xlRgAdh6RfhliI1/img/traceloop-integrations/posthog-result.png?fit=max&auto=format&n=3xlRgAdh6RfhliI1&q=85&s=6d64843bf6bcd94c198737ccfe4b78a7" width="1619" height="1062" data-path="img/traceloop-integrations/posthog-result.png" />
</Frame>
