Skip to main content

Meta Pixel

Source code Package Browser ES5

With Meta Pixel you can track visitor activity on a website and track conversions to appear in the Meta Ads Manager.

Installation

Install the destination via npm

npm i @elbwalker/destination-web-meta-pixel
import { elb } from '@elbwalker/walker.js';
import destinationMetaPixel from '@elbwalker/destination-web-meta-pixel';

elb('walker destination', destinationMetaPixel, config);

Configuration

Configure your meta pixel destination with your Pixel ID.

Example

const config = {
custom: {
pixelId: '1234567890', // Required
},
mapping: {
order: {
complete: {
name: 'Purchase',
data: {
map: {
currency: { value: 'EUR' },
value: 'data.total',
contents: {
loop: [
'nested',
{
map: {
id: 'data.id',
quantity: { key: 'data.quantity', value: 1 },
},
},
],
},
content_type: { value: 'product' },
},
},
},
},
},
};

Custom

PropertyTypeDescription
pixelId*stringAds account ID used for every conversion
currencystringDefault currency for conversions
pageviewbooleanWhether to send the PageView event

Properties with a * are required.

CustomEvent

For the custom event mapping (mapping.entity.action.custom):

For track, use one of the official standard event names, otherwise trackCustom will be used.

PropertyTypeDescription
content_idsstringData property key to use in content_ids, e.g., "data.product_ids".
content_namestringData property key to use as content_name, e.g., "data.product_name".
content_typestringType of content, e.g., "product".
contentsobjectContains id and quantity for content, accessible via wildcard.
trackstringStandard event to track, e.g., "Purchase".
valuestringData property key for value, e.g., "data.value".

contents is an object with the following properties:

  • id: PropertyMapping (string or object with key and optional default)
  • quantity: PropertyMapping (string or object with key and optional default)
info

If you need professional support with your walkerOS implementation, check out our services.