---
description: Getting started with Meta Pixel and setting it up
---

# Meta Pixel

Meta Pixel is a JavaScript snippet that can be added to your website to track visitor activity and other important metrics to build marketing and advertising campaigns.

It collects data such as HTTP headers, Pixel ID, Meta cookie, buttons clicked by site visitors, conversion value, and website field names.

## Getting started

The Meta Pixel makes conversion tracking, optimization, and re-marketing easier than ever.

## Use Cases of Meta Pixel&#x20;

<table><thead><tr><th width="228">Connection</th><th width="196.0964068631223">Web</th><th width="165.9035931368777">Mobile</th></tr></thead><tbody><tr><td><strong>​Device Mode</strong></td><td>✅</td><td>🚫</td></tr><tr><td><strong>Cloud Mode</strong></td><td>🚫</td><td>🚫</td></tr></tbody></table>

#### Use Meta pixel to build Lookalike Audiences&#x20;

A Lookalike Audience is a way your ads can reach new people who are likely to be interested in your business. This is because they share similar characteristics to your existing customers.

A Lookalike Audience uses an existing Custom Audience that you select for its source audience. To create a Lookalike Audience, our system leverages information such as demographics, interests and behaviours from your source audience to find new people who share similar qualities. When you use a Lookalike Audience, your ad is delivered to that audience of people who are similar to (or "look like") your existing customers.

#### Use Meta pixel to track and improve conversions

You can use the Meta Pixel to track your website visitors' actions also known as conversion tracking. Tracked conversions appear in the Meta Ads Manager and the Meta Events Manager, where they can be used to analyze the effectiveness of your conversion funnel and to calculate your return on ad investment. You can also use tracked conversions to define custom audiences for ad optimization and Advantage+ catalogue ad campaigns. By defining custom audiences, we can identify other Meta users who are likely to convert and target your ads to them.

#### Use Meta Pixel for remarketing

Create Custom Audiences from website visitors.

Dynamic ads help you automatically show website visitors the products they viewed on your website – or related ones.

#### Use Meta Pixel for creating custom conversion&#x20;

Custom conversions let you create rules for events. When you create these rules, you can measure more specific customer actions. For example, you can filter all purchases to measure just purchases of women's shoes over USD 40. Using your custom conversions, you can optimize your ad delivery and reach people who are most likely to take the actions you desire.

<figure><img src="https://1782533751-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FazJDZwzHkmWIbkYOetQH%2Fuploads%2FWeCobQZNopFh3iQ0erwC%2FScreenshot%202022-12-07%20at%204.49.15%20PM.png?alt=media&#x26;token=abcb47f4-36a5-4c64-b13b-ce86b7c65043" alt=""><figcaption><p><em>Create custom conversion</em></p></figcaption></figure>

### Connection

## **Methods**

{% tabs %}
{% tab title="Track" %}
When a `track` event is triggered, it is sent to Meta Pixel as `track` for Meta standard events or `trackCustom` for custom events. You can refer to the below example for a better understanding.

```javascript
fbq('track', 'Purchase', {currency: "USD", value: 30.00});
```
{% endtab %}

{% tab title="Identify " %}
When a `identify` event is triggered, we call Meta Pixel `trackCustom` method and send `identify` as event name with all the customer properties sent with `identify` method. For example:

```javascript
fbq('trackCustom', 'identify', {name: "John Doe", city: "Mumbai"});
```
{% endtab %}

{% tab title="Page" %}
When a `page` event is triggered, we call Meta Pixel `track` method and send `PageView` as event name with page event parameters. For example:

```javascript
fbq('track', 'PageView', {name: "home", title: "Home Page", path: "/home"});
```
{% endtab %}
{% endtabs %}

### Meta Pixel Standard Events

Meta Pixel has a list of standard events. As per Meta Pixel documentation,&#x20;

> Standard events are predefined by meta and can be used to log conversions, optimise for conversions and build audiences.

To see all the standard event lists and their description you can [click here](https://www.facebook.com/business/help/402791146561655?id=1205376682832142).&#x20;

{% hint style="info" %}
You can have both Standard and Custom properties in Standard Events&#x20;
{% endhint %}

### Meta Pixel Custom Events

Custom events are actions that fall outside of those covered by our standard events. You can give them a unique name to represent the action taking place. In your pixel code or Conversions API code, you can log custom events, optimize for conversions, and build audiences based on those custom events.

You can track custom events by calling the Pixel's `fbq('trackCustom')` function, with your custom event name and (optionally) a JSON object as its parameters. Fbq('trackCustom') can be called anywhere between your webpage's opening and closing body tags, either when the page loads or when a visitor clicks a button.

`For example:-`

```javascript
fbq('trackCustom', 'ShareDiscount', {promotion: 'share_discount_10%'});
```

{% hint style="info" %}
You can have both Standard and Custom properties in Custom Events. Custom event names must be strings, and cannot exceed 50 characters in length.
{% endhint %}

## Custom Data Parameters <a href="#custom-data-parameters" id="custom-data-parameters"></a>

Use these parameters to send additional data for ads delivery optimization.

Example:

```javascript
<script>
fbq('track', 'ViewContent', {
  content_name: 'Really Fast Running Shoes',
  content_category: 'Apparel & Accessories > Shoes',
  content_ids: ['1234'],
  content_type: 'product',
  value: 0.50,
  currency: 'USD'
  predicted_ltv: '0.00'
 });
</script>
```

{% hint style="info" %}
Here`content_name,content_category,content_ids,content_type,value, currency,predicted_ltv`are some of the custom properties.&#x20;
{% endhint %}

{% hint style="info" %}
For more on Custom data parameters click [here](https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/custom-data).&#x20;
{% endhint %}

### Setting up Meta Pixel destination in Lemnisk

You will have to perform the following steps in the Lemnisk app to add Meta Pixel as a destination.

**Step 1:** Navigate to **CONNECT** > **Connections** > **Destinations** and click **+Create Destination**.&#x20;

**Step 2:** A **Catalog** pop-up appears. Select **Meta Pixel** and click **Continue**.

**Step 3:** Select a source of your choice by checking the box adjacent to the source and then click **Continue**.&#x20;

**Step 4:** Type a unique name that acts as your destination identifier. Click **Create Destination**.&#x20;

**Step 5:** The **Overview** tab appears with the details of the destination you just created. &#x20;

**Step 6:** Click **+Add Sources** and select a source(s) of your choice by checking the box adjacent to the source, then click **Continue**.&#x20;

**Step 7:** In the **Name** field, type a unique name.&#x20;

**Step 8:** Toggle the **Status** button to activate the destination. You will be prompted to confirm your actions.&#x20;

**Step 9:** Click **Yes, Activate**. You will be redirected to the **Configuration** tab.

**Step 10:** Type or paste your **Pixel ID**, from the snippet created on the Meta Pixel creation page.

**Step 11:** In the **Map, your events with Meta Standard Events** field, type the field name in the field name text box and then select the event you want to map it to from the adjacent drop-down.&#x20;

**Step 12:** To add more fields, click **+Add Field**.&#x20;

**Step 13:** The [**Limited Data Use**](#limited-data-use), [**Enable Advanced Matching**](#enable-advanced-matching) and **Send UserId as External ID** options are disabled by default. You can use the toggle button to enable or disable the options.&#x20;

**Step 14:** Click **Update Destination**.

<figure><img src="https://1782533751-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FazJDZwzHkmWIbkYOetQH%2Fuploads%2FBuhKmu3ycXhJChqLdVd0%2FMeta%20Pixel.gif?alt=media&#x26;token=05e539f1-9e51-488b-8e9b-aa5f7e8050c6" alt=""><figcaption><p><em>Setting up destination</em> </p></figcaption></figure>

### Verify Pixel events on Meta

To verify events at Meta Pixel, go to [Meta Events Manager](https://www.facebook.com/events_manager2/overview?act=1079585740106933) and select the Pixel from the left bar. You can verify the integration by checking events sent to Meta Pixel in the dashboard. For reference, check the below image:

<figure><img src="https://1782533751-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FazJDZwzHkmWIbkYOetQH%2Fuploads%2F9YpyOlctkfSz4uWqBu0z%2FScreenshot%202022-12-08%20at%208.46.43%20AM.png?alt=media&#x26;token=0f56503a-acf2-42bb-a914-b515ebb58d93" alt=""><figcaption><p><em>Verify pixel events</em> </p></figcaption></figure>
