set-fb-cookies
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

Set Facebook Cookies

This simple script sets the _fbp and _fbc cookies when Pixel doesn't.

In Belgium, the served Pixel script is different than in the rest of the world: it's missing pieces of code for handling first-party cookies. This affects other parts of the Pixel code including the correct handling of tracking in iOS 14.5+, and prevents us from reading the cookies for use with the Conversion API.

This package is reimplements the missing piece of the Pixel which sets _fbc and _fbp.

<script async defer src="https://unpkg.com/set-fb-cookies">
import setFbCookies from "set-fb-cookies";

setFbCookies();
const setFbCookies = require("set-fb-cookies").default;

setFbCookies();

Better yet, if you want to use only the Conversion API you can use this script to generate _fbc and _fbp which you can then pass to your Server. This makes it possible to skip using the browser Pixel.

Readme

Keywords

none

Package Sidebar

Install

npm i set-fb-cookies

Weekly Downloads

314

Version

0.0.3

License

MIT

Unpacked Size

20.4 kB

Total Files

19

Last publish

Collaborators

  • hansottowirtz