5.0.2 • Published 8 months ago

@captive/capacitor-facebook-analytics v5.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

capacitor-facebook-analytics

this is a capacitor 4 plugin for facebook analytics

Install

yarn install capacitor-facebook-analytics
npx cap sync

Usage

import { FacebookAnalytics, FacebookEventName } from '@captive/capacitor-facebook-analytics';

// enable advertiser tracking for IOS
FacebookAnalytics.enableAdvertiserTracking();

// log event : completed registration
FacebookAnalytics.logEvent({ event: FacebookEventName.CompletedRegistration });

API

initAppEvents()

initAppEvents() => Promise<string>

Returns: Promise<string>


logEvent(...)

logEvent(options: { event: FacebookEventName | string; valueToSum?: number; params?: any; }) => Promise<string>

Send an event to Facebook

FacebookAnalytics.logEvent({ event: <a href="#facebookeventname">FacebookEventName</a>.CompletedRegistration })

// OR

FacebookAnalytics.logEvent({ event: 'fb_mobile_complete_registration' })
ParamType
options{ event: string; valueToSum?: number; params?: any; }

Returns: Promise<string>


enableAdvertiserTracking()

enableAdvertiserTracking() => Promise<void>

Only for IOS versions greater than 14


disableAdvertiserTracking()

disableAdvertiserTracking() => Promise<void>

getAdvertiserTrackingStatus()

getAdvertiserTrackingStatus() => Promise<boolean>

Returns: Promise<boolean>


Type Aliases

FacebookEventName

Enum of all Facebook standard events

Table of correspondence :

ActivatedApp: 'fb_mobile_activate_app', DeactivatedApp: 'fb_mobile_deactivate_app', SessionInterruptions: 'fb_mobile_app_interruptions', TimeBetweenSessions: 'fb_mobile_time_between_sessions', CompletedRegistration: 'fb_mobile_complete_registration', ViewedContent: 'fb_mobile_content_view', Searched: 'fb_mobile_search', Rated: 'fb_mobile_rate', CompletedTutorial: 'fb_mobile_tutorial_completion', PushTokenObtained: 'fb_mobile_obtain_push_token', AddedToCart: 'fb_mobile_add_to_cart', AddedToWishlist: 'fb_mobile_add_to_wishlist', InitiatedCheckout: 'fb_mobile_initiated_checkout', AddedPaymentInfo: 'fb_mobile_add_payment_info', Purchased: 'fb_mobile_purchase', AchievedLevel: 'fb_mobile_level_achieved', UnlockedAchievement: 'fb_mobile_achievement_unlocked', SpentCredits: 'fb_mobile_spent_credits',

(typeof FacebookEventName)keyof typeof FacebookEventName

5.0.2

8 months ago

5.0.1

11 months ago

5.0.0

11 months ago

1.0.0

1 year ago

1.0.0-alpha.4

2 years ago

1.0.0-alpha.3

2 years ago

1.0.0-alpha.2

2 years ago

1.0.0-alpha.1

2 years ago

1.0.0-alpha.0

2 years ago