# Getting started

# Requirements

# Install Plugin

The plugin can be installed via the Plugin Store in the Craft Control Panel.

Or, open your terminal, go the Craft project and install the plugin via Composer:

# Setup the Pixel ID

If your website doesn't have a Facebook Pixel yet, start by creating one:

  1. Go to Events Manager (opens new window).
  2. Click Connect Data Sources and select Web.
  3. Select Facebook Pixel and click Connect.
  4. Add your Pixel Name.
  5. Enter your website URL to check for easy setup options.
  6. Click Continue.

# Configuration

As soon as the Plugin is installed you can start configuring via the settings page.

The Facebook Pixel ID can be copied in the Data Source screen.

Screenshot

The Access Token can get generated in the Settings tab.

Screenshot

When sending server events to Facebook they won't show in real-time, which doesn't help to validate and debug the integration. Luckily there is a way to debug more easily, when adding a Test Event Code the events will load in real-time in the Test Events tab.

WARNING

Only fill in the Test Event Code when you're validating or debugging the integration.

Screenshot

# Template

If you Facebook Pixel is not added directly in the Template, or not added by another Plugin (E.g. SEOmatic), you can add it through the Facebook Conversion Plugin. In order to do so, add the following Twig hook to the head of your page in your template:

{% hook 'facebook-conversion-head-tag' %}

E.g.:

<head>
    <meta charset="utf-8">

    <title>My Website</title>

    {% hook 'facebook-conversion-head-tag' %}
</head>
<body>

Please follow the government regulations that apply to your business. Be aware that for EU countries the "Cookie Law" also applies to Server Events and other technologies. Make sure to update your Privacy Policy and ask for consent before sending any data to partners such as Facebook.

The use of the Plugin, its functionality, and the legal implementation is the responsibility of the owner of the website.