How to Set Up Analytics for Crypto and DeFi Apps Using Turnkey

Step-by-Step Guide to Analytics for Crypto and DeFi Apps Using Turnkey

Step-by-Step Guide to Analytics for Crypto and DeFi Apps Using Turnkey

Step-by-Step Guide to Analytics for Crypto and DeFi Apps Using Turnkey

Yos Riady
Yos Riady

Yos Riady

Last Updated

Last Updated

27 Feb 2026

27 Feb 2026

Crypto and DeFi app builders grapple with fragmented data from onchain transactions and in-app events, obscuring user retention and acquisition metrics. This step-by-step guide outlines integration of Turnkey embedded wallets with Formo to unify analytics, wallet profiles, and real-time alerts. Leading teams achieve clearer growth signals through this privacy-friendly setup.

What is Turnkey Embedded Wallets?

Turnkey provides secure, scalable, and programmable infrastructure for crypto applications. Unlike traditional wallet solutions that rely on browser extensions, Embedded Wallets are integrated directly into an application's interface. This architecture allows users to generate and utilize a wallet without leaving the app, significantly reducing friction during onboarding.

The platform utilizes a unique security model based on secure enclaves, ensuring that raw private keys are never exposed to the application or its developers. For high-performance needs, the infrastructure supports signing latency of just 50-100ms for millions of wallets (Turnkey). This speed and security make it an ideal foundation for building consumer-grade crypto experiences that feel like standard web applications while maintaining non-custodial standards.

What Are Analytics for Crypto and DeFi Apps Important?

Standard web analytics tools like Google Analytics track page views and clicks but fail to capture the economic reality of a Web3 application. They cannot see onchain activity, meaning a user who connects a wallet and swaps $10,000 worth of tokens looks identical to a user who connects and does nothing.

For crypto apps, success is measured by onchain KPIs:

  • Wallet Retention: Do users return to transact after 7 or 30 days?

  • Net New TVL: Is the protocol attracting actual liquidity?

  • Customer Acquisition Cost (CAC): How much marketing spend is required to acquire a funded wallet?

Without specialized analytics, teams operate blindly, unable to distinguish between high-value users ("whales") and bots or casual browsers.

Why Formo Transforms Analytics for Crypto Apps

Formo addresses the data gap by unifying offchain user behavior with onchain transaction data. For developers using Turnkey, Formo offers specific advantages through its deep integration with standard Ethereum libraries.

  • Native Wagmi Integration: The SDK hooks directly into Wagmi's state management system.

  • Mutation Cache Tracking: It tracks signatures and transactions via TanStack Query's mutation cache, ensuring no event is missed.

  • Privacy-First Identity: It resolves identity without compromising user anonymity.

By combining these layers, builders can see the full funnel—from a marketing click to a Turnkey wallet creation, and finally to a completed onchain transaction.

Step-by-Step Guide to Setting Up Analytics with Turnkey

Step 1: Create a Turnkey Organisation and API Credentials

To begin, developers must establish the organizational hierarchy within Turnkey. This structure is critical for managing user permissions and data isolation securely.

  • Organizations (Parent Orgs): This represents the application itself. It holds the global policies and configurations.

  • Sub-organizations (Sub-orgs): These are nested under the parent and typically represent individual end users. This ensures that one user's keys are fully segregated from another's.

  • Authenticators: These are the credentials (passkeys, API keys) that allow users to access their sub-organizations.

Correctly setting up this hierarchy ensures that analytics data can later be mapped to persistent user identities.

Step 2: Integrate Embedded Wallets into Your Crypto or DeFi App

Once the organization is configured, the next step is integrating the wallet kit into the frontend. Turnkey allows for the creation of thousands of non-custodial wallets simultaneously, which is essential for apps expecting high volume.

"With Turnkey you can: Create thousands of non-custodial embedded wallets at once, Configure multi-sig wallets requiring m-of-n signatures, Set advanced policies, like allowlists or transaction limits." - Turnkey (Turnkey)

Step 3: Create a Formo Workspace and Install

After the wallet infrastructure is live, analytics installation follows. Developers should create a workspace in Formo and install the SDK. For applications using Wagmi to manage Turnkey connections, the installation involves wrapping the application in the FormoAnalyticsProvider.

This provider requires the Wagmi configuration and the QueryClient. By passing these options, Formo automatically hooks into the connection state. This setup allows the analytics engine to detect when a Turnkey wallet connects, disconnects, or switches chains without requiring manual event listeners for every interaction.

Step 4: Capture In-App Events and Wallet Profiles

With the Formo SDK installed, the application must be configured to identify users and track specific actions.

  • Identify: Call the identify() function immediately after a user connects their Turnkey wallet. This links the anonymous session to the specific wallet address.

  • Track Custom Events: Use track() for critical actions like "Swap Completed" or "Liquidity Added."

  • Revenue Properties: Include properties like revenue, volume, and points in the event payload.

This granular tracking transforms raw data into a profile, showing not just that a wallet exists, but how much value it brings to the protocol.

Step 5: Set Up Dashboards for Key Metrics and Attribution

Data is only useful when visualized effectively. Teams should configure dashboards that align with specific departmental goals.

  • Executive Dashboards: Focus on high-level metrics like Total Value Locked (TVL), Daily Active Wallets (DAW), and revenue growth.

  • Marketing Dashboards: Track attribution by linking UTM parameters to onchain actions, proving which campaigns drive funded wallets.

  • Product Dashboards: Monitor feature adoption rates and user journey completion, identifying where users drop off during the onboarding flow.

Step 6: Activate Real-Time Alerts and User Segmentation

The final step involves setting up automated responses to data signals. Real-time alerts allow teams to react instantly to critical events.

  • Whale Alerts: Notify the VIP team via Slack when a wallet swaps more than $50,000.

  • Error Monitoring: Trigger engineering alerts if transaction failure rates spike after a deployment.

  • Segmentation: Group users into cohorts such as "High Value," "Churned," or "New Users."

These segments allow for targeted engagement, such as sending a re-engagement offer to users who haven't transacted in 30 days.

Common Mistakes and How to Avoid Them

When implementing analytics on top of embedded wallets, developers often encounter configuration issues that lead to data loss or noise.

1. Ignoring Log Levels

Developers often fail to configure logging correctly during development, making debugging difficult. Use the appropriate log level to isolate issues.

Log Level

Description

trace

Shows the most detailed diagnostic information

debug

Shows all messages, including function context

info

Shows informative messages about normal operation

warn

Default. Shows error and warning messages

error

Shows error messages only

2. Blocking by Ad-Blockers

Client-side analytics can be blocked by browser extensions. To ensure data accuracy, set up a reverse proxy (e.g., via Next.js rewrites) to route analytics traffic through your own domain rather than sending it directly to third-party servers.

Next Steps

Implementing Turnkey and Formo provides a robust foundation for data-driven growth. To maximize the value of this stack, teams should prioritize the following actions:

  • Audit Data: Verify that wallet connection events and transaction signatures are capturing correctly in the staging environment.

  • Define KPIs: Select 3-5 core metrics (e.g., Weekly Active Wallets, Net Deposits) to track consistently.

  • Iterate: Use the insights from user segmentation to refine the onboarding flow and improve retention.

  • Visualize: Use Formo's chartbuilder, funnels, and retention charts to build and share reports with your whole team.

By treating analytics as a product feature rather than an afterthought, builders can make informed decisions that drive sustainable protocol growth.

FAQs

Is Turnkey secure for non-custodial wallets?

Turnkey uses secure enclaves to ensure that private keys are never exposed to the developer or the Turnkey team. As stated in their security overview:

"Turnkey’s code can be independently verified, replacing blind trust with cryptographic proof." - Turnkey Security Overview (Turnkey)

Does Formo compromise user privacy?

No. Formo is designed for the pseudonymous nature of Web3. It tracks behavior associated with a wallet address but does not collect personal identifiable information (PII). Formo does not collect IP addresses and does not make use of third-party cookies and device fingerprinting.

Can I track transactions across different chains?

Yes. Formo supports all major EVM-compatible chains and Solana. It automatically detects chain switches and tracks transactions regardless of the network, providing a unified view of user activity across the ecosystem.

What is the pricing for Turnkey Embedded Wallets?

Turnkey offers a usage-based pricing model starting at $0.25 per 1,000 wallet creations and $0.10 per signature. Developers access a free tier for testing up to 10,000 monthly active wallets.

What EVM chains does Formo support with Turnkey?

Formo supports all major EVM chains including Ethereum, Polygon, Arbitrum, Optimism, and Base. Chain ID detection in Wagmi ensures seamless multi-chain tracking for Turnkey wallets.

Can Formo integrate with other wallet providers besides Turnkey?

Yes, Formo works with Privy, Dynamic, WalletConnect, and other providers via Wagmi. The SDK adapts to any Ethereum-compatible connection for unified onchain analytics.

Check out our related articles

Table of contents

Share this post

Share this post

Measure what matters

Formo makes analytics and attribution simple for onchain apps.

Measure what matters

Formo makes analytics and attribution simple for onchain apps.

Measure what matters

Formo makes analytics and attribution simple for onchain apps.