Getting Started

Welcome to the Fakebook Marketing documentation.

Whether you are a new or an advanced user, you can find some useful information here.

Go ahead, dive in!

Firstly, please, find our extension in My Downloadable Products section of our store. Learn how to install extension.

How to install the extension

How to install the extension using composer

  1. Backup your store's database and web directory.
  2. Login to the SSH console on your server and navigate to the root directory of the Magento 2 store.
  3. Copy the installation instructions from the page My Downloadable Products to the SSH console and press ENTER.

  4. Enable the extension:

        php -f bin/magento module:enable Mirasvit_Core Mirasvit_Tm Mirasvit_FbMarketing
  5. Install the extension:

        php -f bin/magento setup:upgrade
  6. Clean the cache

        php -f bin/magento cache:clean
  7. Deploy static view files
        rm -rf pub/static/*     
        rm -rf var/view_preprocessed/*  
        php -f bin/magento setup:static-content:deploy

How to install the extension manually

  1. Backup your store's database and web directory.
  2. Download archive from My Downloadable Products.
  3. Unzip the extension locally.
  4. Copy unzipped folder to the root directory of the Magento store.
  5. Enable the extension:

        php -f bin/magento module:enable Mirasvit_Core Mirasvit_Tm Mirasvit_FbMarketing
  6. Install the extension:

        php -f bin/magento setup:upgrade
  7. Clean the cache

        php -f bin/magento cache:clean
  8. Deploy static view files
        rm -rf pub/static/*     
        rm -rf var/view_preprocessed/*  
        php -f bin/magento setup:static-content:deploy

Install the extension for Hyva

  1. Run the command

        composer require mirasvit/module-fb-marketing-hyva:*
  2. Enable installed Hyva modules:

        bin/magento module:enable Hyva_MirasvitFbMarketing
  3. Update Magento database schema and data with the command:

        bin/magento setup:upgrade
  4. Compile the code of the installed extension:

        bin/magento setup:di:compile
  5. Run the command below to clean the cache:
        bin/magento cache:flush

Quick Start

Our Facebook Marketing for Magento 2 is a simple, yet powerful extension that allows you to track the shopping behavior of your customers. Gathered data is supplied through the Google Tag Manager service to Google Enhanced Ecommerce analytics to get hints on how to increase marketing ROI and boost sales.

Use this extension to track the shopping behavior of customers. Know when they add/remove/view cart, add to wishlist, begin checkout, make purchase, choose shipping and payment methods, and many other actions.

Configuration Settings

The module Google Tag Manager for Magento 2 requires a prior configuration before it is fully ready to use.

Navigate to Store > Settings > Configuration > Mirasvit Extensions > Facebook Marketing to open the module's settings.

Option Description
Enable Facebook Pixel Set it to yes to allow integration of Facebook's tracking code into your website,
Facebook Pixel ID Field for a Unique identifier assigned to the Facebook Pixel that you create within your Facebook Ads Manager account. Follow the Facebook manual to get the Pixel ID.
Facebook Pixel code Paste here a piece of JavaScript code provided by Facebook for your Meta Pixel. This code snippet contains your unique Facebook Pixel ID and is responsible for tracking user interactions on your website, such as page views, clicks, and conversions.
Pixel Domain Verification Paste here a meta tag to verify ownership of your store domain where you've installed the Meta Pixel.
Access Token A field for a unique identifier provided by Facebook that allows to securely connect your server directly to Facebook's Conversions API.

Setup Facebook Marketing

In order to connect your Magento 2 store to the Facebook using our extension, it is required that you create a business account on the Facebook. Facebook Marketing is used for data collection, and to analyze it with Enhanced Ecommerce reports.

To connect your store with the Facebook analytics, activate the Facebook Marketing extension and copy-paste Facebook code snippets into the setting fields.

Ensure you have a Facebook account with enough access rights to access the Facebook Ads Manager.

1. Get Meta Pixel code snippets and access token

In your Facebook open Ads Manager > Events Manager. Follow the manual from Meta (Facebook) to create the Meta Pixel. Copy the provided Pixel ID, Picel code snippet and Pixel domain verification code.

Get the access token for the Conversion API. Follow the manual form Meta to get the access token.

2. Install Pixel in your store

In your Magento admin navigate to Store > Settings > Configuration > Mirasvit Extensions > Facebook Marketing do the following:

  • Set Enable Facebook Pixel to yes
  • In Facebook Pixel ID paste the Pixel identification number obtained on the step one
  • In Facebook Pixel code paste the Pixel snipped code
  • In Pixel Domain Verification paste the Pixel domain verification code
  • In Access Token paste the API access token

Note

Meta Pixel may require some time for activation. It may take from several minutes to several hours before Pixel will start sending data to your Facebook Ads Manager account.

How to upgrade extension

To upgrade the extension, follow these steps:

  1. Backup your store's database and web directory.
  2. Login to the SSH console of your server and navigate to the root directory of the Magento 2 store.
  3. Update the extension with all dependencies:
        composer require mirasvit/module-fb-marketing:* --update-with-dependencies

    Note

    In some cases, the command above is not applicable, or it's not possible to update just the current module, or you need to upgrade all Mirasvit modules in a bundle. In this case, the command above will have no effect.

    Run instead composer update mirasvit/* command. It will update all Mirasvit modules installed in your store.

  4. Install the updates:

        php -f bin/magento setup:upgrade
  5. Clean the cache

        php -f bin/magento cache:clean
  6. Deploy static view files
        rm -rf pub/static/*     
        rm -rf var/view_preprocessed/*  
        php -f bin/magento setup:static-content:deploy

Disabling the Extension

Temporarily Disable

To temporarily disable the extension please follow these steps:

  1. Login to the SSH console on your server and navigate to the root directory of the Magento 2 store.
  2. Disable the extension:
        php -f bin/magento module:disable Mirasvit_FbMarketing
  3. Log in to the Magento backend and refresh the store cache (if enabled).

Extension Removal

To uninstall the extension, please follow these steps:

  1. Login to the SSH console on your server and navigate to the root directory of the Magento 2 store.
  2. Disable the extension:

        php -f bin/magento module:disable Mirasvit_FbMarketing
  3. Remove the extension:
        composer remove mirasvit/module-fb-marketing
  4. Log in to the Magento backend and refresh the store cache (if enabled).

1.0.9

(2024-05-17)

Fixed

  • Compatibility with GTM admin order server tracking

1.0.8

(2024-03-01)

Fixed

  • OAuthException for conversion api requests for events with products that have float qty: Invalid parameter "code":100,"error_subcode":2804019

1.0.6

(2024-02-09)

Fixed

  • FacebookAds returns wrong remote address

Improvements

  • Advanced Matching improvement

1.0.5

(2023-01-10)

Fixed

  • AddToCart track does not push data to dataLayer

1.0.4

(2023-01-02)

Improvement

  • Added multistore configuration

1.0.3

(2023-11-22)

Improvement

  • Tracking ajax event "AddCart"

1.0.2

(2023-11-17)

Improvement

  • Compatibility with the latest ^18 version of the facebook/php-business-sdk

Fixed

  • Warning: Undefined variable $content in AttachFacebookCode.php

1.0.1

(2023-10-25)

Fixed

  • Added conflict to composer for old GTM module versions

1.0.0

(2023-10-12)

Features

  • Initial release