# 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:

:::flutter
```dart
@override
void handleSuperwallEvent(SuperwallEventInfo eventInfo) async {
  print("handleSuperwallEvent: $eventInfo");

  // Example usage...
  switch (eventInfo.event.type) {
    case EventType.appOpen:
      print("appOpen event");
    case EventType.deviceAttributes:
      print("deviceAttributes event: ${eventInfo.event.deviceAttributes} ");
    case EventType.paywallOpen:
      final paywallInfo = eventInfo.event.paywallInfo;
      print("paywallOpen event: ${paywallInfo} ");

      if (paywallInfo != null) {
        final identifier =  await paywallInfo.identifier;
        print("paywallInfo.identifier: ${identifier} ");

        final productIds =  await paywallInfo.productIds;
        print("paywallInfo.productIds: ${productIds} ");
      }
    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`:

:::flutter
```dart
@override
void handleSuperwallEvent(SuperwallEventInfo eventInfo) async {
  // Example usage...
  switch (eventInfo.event.type) {
    case PlacementType.appOpen:
      print("appOpen event");
    case PlacementType.deviceAttributes:
      print("deviceAttributes event: ${eventInfo.event.deviceAttributes} ");
    case PlacementType.paywallOpen:
      final paywallInfo = eventInfo.event.paywallInfo;
      print("paywallOpen event: ${paywallInfo} ");

      if (paywallInfo != null) {
        final identifier =  await paywallInfo.identifier;
        print("paywallInfo.identifier: ${identifier} ");

        final productIds =  await paywallInfo.productIds;
        print("paywallInfo.productIds: ${productIds} ");
      }
    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).