Send analytics

Analytics come from your own app, not from Canopy and not from the tester app. Your app sends events to Canopy as people use it. Installing a build does not create analytics by itself.

Watch: analytics in action

The video shows the analytics dashboard once events are flowing: active wallets, event counts, and trends, all tied to wallets. Addresses are hashed on the device, so we never see the plain address. Here is how to set it up for your own app.

You need two things: an API key and your app ID. Then you add the Canopy SDK to your app.

1. Get an API key

In the dashboard, go to Settings, then API Keys, and create a key. It looks like cnp_live_.... Copy it right away. You only see it once.

2. Get your app ID

Open your app in the dashboard. The app ID is the long id in the address bar, the part after /apps/. Copy it.

3. Add the SDK

Add the package to your React Native app:

npm install @canopy/react-native

Wrap your app with the provider and pass your key and app ID:

import { CanopyProvider } from "@canopy/react-native";

export default function App() {
  return (
    <CanopyProvider config={{
      apiKey: "cnp_live_...",
      appId: "your-app-id",
    }}>
      {/* your app */}
    </CanopyProvider>
  );
}

4. Track events

An app_open event is sent for you when the app starts. To send your own events, use the hook:

import { useCanopy } from "@canopy/react-native";

function Screen() {
  const { track, identify } = useCanopy();

  // Tie events to a wallet. The address is hashed on the
  // device, so the plain address is never sent to us.
  identify(walletAddress);

  track("swap_done", { amount: 10 });
}

When will I see data?

Ship a build with the SDK in it and use the app. Events show up in the dashboard under your app's Analytics within about a minute.

If you still see nothing, check that the API key is correct and not revoked, and that the app ID matches the app you are looking at.