New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@nurliman/facebook-conversion-api

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nurliman/facebook-conversion-api

Facebook Conversion API Wrapper for Node.js

  • 3.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Facebook Conversion API

Node.js wrapper for Facebook's Conversion API

Install

npm install @nurliman/facebook-conversion-api

Initiate Facebook Conversion API

// ES6 import or TypeScript
import FacebookConversionAPI from "@nurliman/facebook-conversion-api";
// CommonJS
const FacebookConversionAPI = require("@nurliman/facebook-conversion-api").default;

const FBConversionAPI = new FacebookConversionAPI(
  "accessToken",
  "pixelId",
  ["email1", "email2"], // or null
  ["phone1", "phone2"], // or null
  "clientIpAddress",
  "clientUserAgent",
  "fbp", // or null
  "fpc", // or null
  "externalId", // or null
  "debug", // default to false
);

Read more here on how you can get your access token and fbp/fpc identifiers.

ViewContent Event

FBConversionAPI.addProduct("productId", quantity);
FBConversionAPI.sendEvent(
  "ViewContent",
  sourceUrl,
  { value: 1000, currency: "USD" },
  { eventId: "eventId" },
);

Add To Cart Event

FBConversionAPI.addProduct("productId", quantity);
FBConversionAPI.sendEvent(
  "AddToCart",
  sourceUrl,
  { value: 1000, currency: "USD" },
  { eventId: "eventId" },
);

Initiate Checkout Event

FBConversionAPI.addProduct("productId", quantity);
FBConversionAPI.sendEvent(
  "InitiateCheckout",
  sourceUrl,
  { value: 1000, currency: "USD" },
  { eventId: "eventId" },
);

Purchase Event

FBConversionAPI.addProduct("productId", quantity);
FBConversionAPI.sendEvent(
  "Purchase",
  sourceUrl,
  { value: 1000, currency: "USD" },
  { eventId: "eventId" },
);

FAQs

Package last updated on 09 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc