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:
composer require dwy/facebook-conversion
./craft plugin/install facebook-conversion
For more information, check the Create a Facebook Pixel in Business Manager article in the official documention.
In the Events Manager:
For more information, check the Create an Access Token for Conversions API in Guided Setup article in the official documention.
Can be used to test the implementation.
test_event_code
to the Settings page of the pluginMake sure an event that can be linked to a user by Facebook (i.e. Purchase event, by having a valid fbclid
parameter, etc) is used when testing.
The Facebook Pixel can be added to your template by adding the facebook-conversion-head-tag
hook to the head of the page and the facebook-conversion-body-tag
to the body. For example:
<head>
<meta charset="utf-8">
<title>My Website</title>
{% hook 'facebook-conversion-head-tag' %}
</head>
<body>
{% hook 'facebook-conversion-body-tag' %}
Please note, when the Facebook Pixel is already added by another plugin (E.g. SEOmatic) don't add the template hook to avoid duplication.
Brought to you by Digital With you, follow us on Instagram