npm

capacitor-facebook-events
TypeScript icon, indicating that this package has built-in type declarations

6.0.3 • Public • Published

capacitor-facebook-events

Facebook events tracking in Capacitor applications

Install

npm i --save capacitor-facebook-events
npx cap sync

API

setAdvertiserTrackingEnabled(...)

setAdvertiserTrackingEnabled(options: { enabled: boolean; }) => Promise<void>
Param Type
options { enabled: boolean; }

logEvent(...)

logEvent(options: { event: string; params?: any; }) => Promise<void>
Param Type
options { event: string; params?: any; }

Example Usage

Logging a Registration Event

To log a registration event, use the 'fb_mobile_complete_registration' event name:

import { FacebookEvents } from 'capacitor-facebook-events';

// ...

FacebookEvents.logEvent({
event: 'fb_mobile_complete_registration',
params: {
// Additional parameters (optional)
}
});

Logging a Purchase Event

For logging a purchase event, use the 'fb_mobile_purchase' event name with relevant parameters:

import { FacebookEvents } from 'capacitor-facebook-events';

// ...

FacebookEvents.logEvent({
    event: 'fb_mobile_purchase',
    params: {
        fb_content_id: 'item_id', // Item ID
        fb_content_type: 'product',
        fb_currency: 'currency_code',
        _valueToSum: amount // Purchase amount
    }
});

For a comprehensive list of events, refer to the Facebook App Events API documentation.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
6.0.341latest

Version History

VersionDownloads (Last 7 Days)Published
6.0.341
6.0.22
6.0.10
6.0.00
5.0.10
5.0.00
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i capacitor-facebook-events

Weekly Downloads

39

Version

6.0.3

License

MIT

Unpacked Size

29.6 kB

Total Files

28

Last publish

Collaborators

  • gketata