# 3rd Party Analytics

Hooking up Superwall events to 3rd party tools [#hooking-up-superwall-events-to-3rd-party-tools]

SuperwallKit automatically tracks some internal events. You can [view the list of events here](/docs/sdk/guides/3rd-party-analytics/tracking-analytics). We encourage you to also track them in your own analytics by implementing the [Superwall delegate](/docs/sdk/guides/using-superwall-delegate). Using the `handleSuperwallEvent(withInfo:)` function, you can forward events to your analytics service:

:::expo
```typescript
handleSuperwallEvent(eventInfo: SuperwallEventInfo) {
  console.log(`handleSuperwallEvent: ${eventInfo}`);

  switch (eventInfo.event.type) {
  case EventType.appOpen:
    console.log("appOpen event");
    break;
  case EventType.deviceAttributes:
    console.log(`deviceAttributes event: ${eventInfo.event.deviceAttributes}`);
    break;
  case EventType.paywallOpen:
    const paywallInfo = eventInfo.event.paywallInfo;
    console.log(`paywallOpen event: ${paywallInfo}`);

    if (paywallInfo !== null) {
      paywallInfo.identifier().then((identifier: string) => {
        console.log(`paywallInfo.identifier: ${identifier}`);
      });

      paywallInfo.productIds().then((productIds: string[]) => {
        console.log(`paywallInfo.productIds: ${productIds}`);
      });
    }
    break;
  default:
    break;
  }
}
```
:::

<br />

> **Note**

You might also want to set user attribute to allow for
[Cohorting in 3rd Party Tools](/docs/sdk/guides/3rd-party-analytics/cohorting-in-3rd-party-tools).



Alternatively, if you want typed versions of all these events with associated values, you can access them via `eventInfo.event`:

:::expo
```typescript
handleSuperwallEvent(eventInfo: SuperwallEventInfo) {
  console.log(`handleSuperwallEvent: ${eventInfo}`);

  switch (eventInfo.event.type) {
  case EventType.appOpen:
    console.log("appOpen event");
    break;
  case EventType.deviceAttributes:
    console.log(`deviceAttributes event: ${eventInfo.event.deviceAttributes}`);
    break;
  case EventType.paywallOpen:
    const paywallInfo = eventInfo.event.paywallInfo;
    console.log(`paywallOpen event: ${paywallInfo}`);

    if (paywallInfo !== null) {
      paywallInfo.identifier().then((identifier: string) => {
        console.log(`paywallInfo.identifier: ${identifier}`);
      });

      paywallInfo.productIds().then((productIds: string[]) => {
        console.log(`paywallInfo.productIds: ${productIds}`);
      });
    }
    break;
  default:
    break;
  }
}
```
:::

> **Info**

Wanting to use events to see which product was purchased on a paywall? Check out this
[doc](/docs/sdk/guides/advanced/viewing-purchased-products).