npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@jonit-dev/capacitor-plugin-facebook-analytics

v1.0.6

Published

Provide Facebook analytics functionality to Capacitor-based projects.

Readme

Capacitor Facebook Analytics Plugin

A Capacitor plugin for Facebook Analytics integration, compatible with Capacitor 7+.

Requirements

  • Capacitor 7.0.0+
  • iOS 14.0+
  • Android API 23+ (Android 6.0)
  • Node.js 20+

Installation

1. Install the plugin

npm install @jonit-dev/capacitor-plugin-facebook-analytics

Or using yarn:

yarn add @jonit-dev/capacitor-plugin-facebook-analytics

2. Sync with Capacitor

npx cap sync

3. Install platform dependencies

iOS

The plugin uses Facebook SDK 17.4.0+ which will be automatically installed via CocoaPods or Swift Package Manager.

Android

The plugin uses Facebook Android SDK 17.0.0+ which will be automatically installed via Gradle.

Configuration

Android Setup

Note: Manual plugin registration is no longer required in Capacitor 7

  1. In android/app/src/main/AndroidManifest.xml, add the Facebook App ID under <application>:
<meta-data android:name="com.facebook.sdk.ApplicationId"
    android:value="@string/facebook_app_id"/>
  1. In android/app/src/main/res/values/strings.xml, add your Facebook App ID:
<string name="facebook_app_id">YOUR_FACEBOOK_APP_ID</string>

Replace YOUR_FACEBOOK_APP_ID with your actual Facebook Application ID from the Facebook App Dashboard.

iOS Setup

In ios/App/App/Info.plist, add your Facebook App configuration:

<key>FacebookAppID</key>
<string>YOUR_FACEBOOK_APP_ID</string>
<key>FacebookDisplayName</key>
<string>YOUR_APP_NAME</string>
<key>FacebookAdvertiserIDCollectionEnabled</key>
<true/>
<key>FacebookAutoLogAppEventsEnabled</key>
<true/>
<key>SKAdNetworkItems</key>
<array>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>v9wttpbfk9.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>n38lu8286q.skadnetwork</string>
    </dict>
</array>

Replace:

  • YOUR_FACEBOOK_APP_ID with your Facebook Application ID
  • YOUR_APP_NAME with your app's display name

iOS 14+ Privacy Features

The plugin now supports iOS 14+ privacy features:

  • SKAdNetwork: Attribution tracking for iOS 14+
  • App Tracking Transparency: Compliant with iOS 14.5+ requirements
  • Advertiser ID Collection: Enabled for improved measurement

Getting Your Facebook App ID

  1. Go to the Facebook App Dashboard
  2. Select your app or create a new one
  3. Copy the App ID from the app dashboard

For more detailed setup instructions, see:

Usage

Import the plugin

import { FacebookAnalytics } from '@jonit-dev/capacitor-plugin-facebook-analytics';

Basic Usage Examples

// Log a custom event
await FacebookAnalytics.logEvent({ 
  event: 'button_click', 
  valueToSum: 1.0, 
  params: { button_id: 'signup_button' } 
});

// Log a purchase
await FacebookAnalytics.logPurchase({ 
  amount: 9.99, 
  currency: 'USD', 
  params: { product_id: 'premium_subscription' } 
});

// Log add to cart
await FacebookAnalytics.logAddToCart({ 
  amount: 19.99, 
  currency: 'USD', 
  params: { item_name: 'widget', category: 'tools' } 
});

// Log payment info added
await FacebookAnalytics.logAddPaymentInfo({ success: 1 });

// Log registration completion
await FacebookAnalytics.logCompleteRegistration({ 
  params: { method: 'email', user_type: 'premium' } 
});

// Log checkout initiation
await FacebookAnalytics.logInitiatedCheckout({ 
  amount: 29.99, 
  params: { num_items: 2, currency: 'USD' } 
});

API Reference

Supported Methods

| Method | Android | iOS | Web | Description | | :-- | :--: | :--: | :--: | :-- | | logEvent | ✅ | ✅ | ❌ | Log custom events | | logPurchase | ✅ | ✅ | ❌ | Log purchase events | | logAddToCart | ✅ | ✅ | ❌ | Log add to cart events | | logAddPaymentInfo | ✅ | ✅ | ❌ | Log payment info events | | logCompleteRegistration | ✅ | ✅ | ❌ | Log registration events | | logInitiatedCheckout | ✅ | ✅ | ❌ | Log checkout events |

Method Signatures

interface FacebookAnalyticsPlugin {
  logEvent(options: { 
    event: string, 
    valueToSum?: number, 
    params?: any 
  }): Promise<string>;
  
  logPurchase(options: { 
    amount: number, 
    currency: string, 
    params?: any 
  }): Promise<string>;
  
  logAddPaymentInfo(options: { 
    success: number 
  }): Promise<string>;
  
  logAddToCart(options: { 
    amount: number, 
    currency: string, 
    params?: any 
  }): Promise<string>;
  
  logCompleteRegistration(options: { 
    params?: any 
  }): Promise<string>;
  
  logInitiatedCheckout(options: { 
    amount: number, 
    params?: any 
  }): Promise<string>;
}

Changelog

1.0.6

  • Updated Facebook SDK to 17.4.0 (latest)
  • Added iOS 14+ privacy support (SKAdNetwork, App Tracking Transparency)
  • Enhanced iOS configuration documentation with privacy settings
  • Fixed code formatting and linting issues

1.0.0

  • Updated for Capacitor 7 compatibility
  • Raised minimum iOS version to 14.0
  • Raised minimum Android API to 23
  • Updated Facebook SDK to 17.0.0
  • Added Swift Package Manager support
  • Removed deprecated APIs